Laravel Helpers are a variety of global “helper” PHP functions. The full list of helpers can be found here: https://laravel.com/docs/8.x/helpers

Miscellaneous Helpers

abort()

The abort function throws an HTTP exception which will be rendered by the exception handler. The example below shows a 400 error.

 
if(! file_exists($myFile)){
abort(400);
}

dd()

The dd function stands for dump and die. The function dumps the given variables and ends execution of the script.


if(! file_exists($myFile)){
dd('file doesn't exist');
}

ddd()

Similar to the dd function. DDD stands for dump, die and debug. This function is useful when testing and error messaging.


if(! file_exists($myFile)){
ddd('file doesn't exist');
}

redirect()

The redirect function returns a redirect HTTP response, or returns the redirector instance if called with no arguments. 


if (! file_exists($path)){
return redirect('/');
}