Suppose you have written Redirect code as follows:
public function destroy($id)
{
$user = User::find($id);
$user->delete();
return Redirect::route('index');
}
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;

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