public function restore(Post $post)
    {
        $this->authorize(PostsPolicy::PERMISSION_UPDATE);

        try {
            $post->restore();

            return $this->jsonResponseSuccess([
                'message' => $this->transNotification('restored', ['title' => $post->title], $post->toArray())
            ]);
        }
        catch (\Exception $e) {
            return $this->jsonResponseError(['message' => $e->getMessage()], 500);
        }
    }
public function restore(Post $post)
    {
        $this->authorize(PostsPolicy::PERMISSION_UPDATE);

        try {
            $post->restore();

            return $this->jsonResponseSuccess([
                'message' => $this->transNotification('restored', ['title' => $post->title], $post->toArray())
            ]);
        }
        catch (\Exception $e) {
            return $this->jsonResponseError(['message' => $e->getMessage()], 500);
        }
    }
public function restore ( Post $ post ) { $ this -> authorize ( PostsPolicy :: PERMISSION_UPDATE ) ; try { $ post -> restore ( ) ; return $ this -> jsonResponseSuccess ( [ 'message' => $ this -> transNotification ( 'restored' , [ 'title' => $ post -> title ] , $ post -> toArray ( ) ) ] ) ; } catch ( \ Exception $ e ) { return $ this -> jsonResponseError ( [ 'message' => $ e -> getMessage ( ) ] , 500 ) ; } }
Restore a trashed post.

@param  \Arcanesoft\Blog\Models\Post  $post

@return \Illuminate\Http\JsonResponse
Restore a trashed post .