app/Http/Controllers/DependantController.php
/**
     * Remove the specified resource from storage.
     *
     * @param  \App\Dependant  $dependant
     * @return \Illuminate\Http\Response
     */
Remove the specified resource from storage.
Remove the specified resource from storage .
public function destroy($id)
    {
        $user_id = auth()->user()->id;
        $dependents= Dependant::findOrFail($id);
        if($dependents && $dependents->user_id){
            $dependents->delete();
            return redirect()->route('dependant.show')->with('dependant_delete','Dependant successfully deleted!');
        } else{
            abort(404);
        }
    }
public function destroy ( $ id ) { $ user_id = auth ( ) -> user ( ) -> id ; $ dependents = Dependant :: findOrFail ( $ id ) ; if ( $ dependents && $ dependents -> user_id ) { $ dependents -> delete ( ) ; return redirect ( ) -> route ( 'dependant.show' ) -> with ( 'dependant_delete' , 'Dependant successfully deleted!' ) ; } else { abort ( 404 ) ; } }
Remove the specified resource from storage.
Remove the specified resource from storage .