Laravel - Ressource CRUD

Article image


The term CRUD is related to the management of digital data. It summarizes the operations or functions that a user needs to create and manage data.

The acronym CRUD stands for the four basic operations for interacting with database applications:

  • Create : Create a data.
  • Read : Read a data.
  • Update : Update a data.
  • Delete : Delete a data.


Each component of the CRUD acronym can be associated with a type of query in SQL as well as an HTTP1,2 method :

Operation SQL HTTP

Laravel - Apply Global Scopes only on certain routes with Middleware

Article image

Laravel include a Query Scopes system. It allow you to add to one or all (depend the type of scope you use) queries a scope with constraints. Query Scopes has 2 types of Scopes :

  • Global Scopes : It allow you to add constraints to all queries for a given model.
  • Local Scopes : It allow you to define common sets of query constraints that you may easily re-use throughout your application.