• Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR) Class 'App\Http\Controllers\Redirect' Not Found

    Suppose you have written Redirect code as follows:

        public function destroy($id)
        {
         $user = User::find($id);
         $user->delete();
         return Redirect::route('index');
        }

    Then when you are debugging it's showing the error as:
    Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR) Class 'App\Http\Controllers\Redirect' not found


    The solution is, you have to import the following  class in controller. 


     use Illuminate\Support\Facades\Redirect;
  • You might also like

    1 comment:

    1. How to solve "Call to undefined method Maatwebsite\Excel\Excel::create()"?
      Please help me.

      ReplyDelete