Laravel is a popular open-source PHP web application framework that is designed to make web development easier and more efficient. It was created by Taylor Otwell in 2011 and has since become one of the most widely used PHP frameworks in the world.
Laravel is built on top of several powerful PHP libraries, including Symfony and Composer, and provides developers with a range of features and tools that make it easy to build complex web applications quickly and efficiently. Some of the key features of Laravel include a powerful routing system, an intuitive templating engine, and a robust ORM (Object-Relational Mapping) system that makes it easy to work with databases.
One of the biggest advantages of using Laravel is its focus on simplicity and ease of use. The framework is designed to be easy to learn and use, even for developers who are new to PHP or web development in general. This makes it a great choice for startups and small businesses that need to build web applications quickly and efficiently.
This cheat sheet provides a quick reference for Laravel developers. It is divided into different tables with headlines separating them.
Routing
Syntax
Description
Route::get($uri, $callback)
Define a route that responds to GET requests
Route::post($uri, $callback)
Define a route that responds to POST requests
Route::put($uri, $callback)
Define a route that responds to PUT requests
Route::delete($uri, $callback)
Define a route that responds to DELETE requests
Route::any($uri, $callback)
Define a route that responds to any HTTP request method
Route::match(['get', 'post'], $uri, $callback)
Define a route that responds to multiple HTTP request methods
Route::redirect($from, $to)
Define a route that redirects from one URI to another
Route::view($uri, $view, $data)
Define a route that returns a view
Route::fallback($callback)
Define a fallback route that responds to any URI that does not match any other route