app/Http/Controllers/CarController.php
/**
     * Remove the specified resource from storage.
     *
     * @param  \App\Car  $car
     * @return \Illuminate\Http\Response
     */
Remove the specified resource from storage.
Remove the specified resource from storage .
public function destroy($id)
    {
        $car = Car::findOrFail($id);
        Transaction::where('car_id',$id)->delete();
        $car->delete();
        return back()->with('error','Data Successfully Deleted');
    }
public function destroy ( $ id ) { $ car = Car :: findOrFail ( $ id ) ; Transaction :: where ( 'car_id' , $ id ) -> delete ( ) ; $ car -> delete ( ) ; return back ( ) -> with ( 'error' , 'Data Successfully Deleted' ) ; }
Remove the specified resource from storage.
Remove the specified resource from storage .