I am trying to hit my destroy API below

Gives me an error
"Call to a member function delete() on null"
Please help
my route definition in web.php is `
Route::resource('posts', 'postcarController'); my controller code is as below
namespace App\Http\Controllers; use Illuminate\Http\Request; use App\PostModell; use Illuminate\Support\Facades\Auth; class postcarController extends Controller { public function __construct() { $this->middleware('auth'); } public function destroy($id) { //PostModel::where('id',$id)->delete(); $post = PostModel::find($id); if($post!=null){ $post->delete(); return response()->json([ 'message' => 'book deleted', ], 200); } } }
`I changed my url to http://127.0.0.1:8000/posts/3 appropriately and get error
The page has expired due to inactivity.
Please refresh and try again.
dd($post)and see if there any records existsdd($post)gives