app/Http/Controllers/MentorController.php
/**
     * Remove the specified resource from storage.
     *
     * @param  \App\Models\Mentor  $mentor
     * @return \Illuminate\Http\Response
     */
Remove the specified resource from storage.
Remove the specified resource from storage .
public function destroy($id)
    {
        $mentor = Mentor::find($id);
        if (!$mentor) {
            return response()->json([
                "status" => "error",
                "message" => "data not found"
            ], 404);
        }
        $mentor->delete();
        return response()->json([
            "status" => "success",
            "message" => "data deleted"
        ]);
    }
public function destroy ( $ id ) { $ mentor = Mentor :: find ( $ id ) ; if ( ! $ mentor ) { return response ( ) -> json ( [ " status " => " error " , " message " => " data not found " ] , 404 ) ; } $ mentor -> delete ( ) ; return response ( ) -> json ( [ " status " => " success " , " message " => " data deleted " ] ) ; }
Remove the specified resource from storage.
Remove the specified resource from storage .