SlideShare a Scribd company logo
4
Most read
Laravel
The PHP Framework For Web Artisans
CRUD Operations Development
By Chen Alon
What is the acronym CRUD?
In computer programming, Create, Read, Update, and Delete are the four basic functions of
persistent storage.
Operation SQL REST API HTTP
Create INSERT .../resource PUT / POST
Read (Retrieve) SELECT .../resource/{id} | .../resource/{id}/resource GET
Update (Modify) UPDATE .../resource/{id} | .../resource/{id}/resource PUT / POST / PATCH
Delete (Destroy) DELETE .../resource/{id} | .../resource/{id}/resource DELETE
How you manage your CRUD operations?
An old project - managing CRUD operations
Do you see any problems?
Problems:
1. The controller class depends
on Eloquent.
2. It’s VERY hard to change the
data access layer.
3. Breaks the DRY principle
4. Adds responsibility to the
controller.
5. Breaks the SOLID principles.
So, how should we manage our CRUD?
(1) Use the Repository Design Pattern
So, how should we manage our CRUD?
(2) Follow the Don’t Repeat Yourself principle
The User Controller The User API Controller
So, how should we manage our CRUD?
(3) Follow the Dependency Inversion principle
Eloquent Implementation MongoDB Implementation
Summary & Resources
1) Use the Repository Design Pattern
Decouple the data layer from the business logic.
2) Follow the Don’t Repeat Yourself principle
Make sure your CRUD operations are available to use across the application.
3) Follow the Dependency Inversion principle (and SOLID in general)
Make sure you can switch your data layer easily.
Today you want to use Eloquent with MySQL,
Tomorrow you will have to switch to MongoDB.
Resources
● https://github.com/andersao/l5-repository/
● https://bosnadev.com/2015/03/07/using-repository-pattern-in-laravel-5/
● https://medium.com/beyond-the-manifesto/why-the-repository-pattern-is-ofte
n-misunderstood-in-the-laravel-community-e840780499f2
Laravel
BUILD SOMETHING AMAZING!
Thank You!

More Related Content

What's hot (20)

PPTX
Introduction to React JS
Arnold Asllani
 
PPTX
Collections and its types in C# (with examples)
Aijaz Ali Abro
 
PDF
Get to know PostgreSQL!
Oddbjørn Steffensen
 
PDF
Clean code
Arturo Herrero
 
PPT
MySQL Atchitecture and Concepts
Tuyen Vuong
 
PDF
Basic SQL
Durgesh Tripathi
 
PDF
PostgreSQL Tutorial For Beginners | Edureka
Edureka!
 
PDF
JavaScript - Chapter 9 - TypeConversion and Regular Expressions
WebStackAcademy
 
PPTX
Getters_And_Setters.pptx
Kavindu Sachinthe
 
PDF
CSS3 Media Queries
Russ Weakley
 
PPTX
A brief introduction to SQLite PPT
JavaTpoint
 
PDF
[Pgday.Seoul 2018] 이기종 DB에서 PostgreSQL로의 Migration을 위한 DB2PG
PgDay.Seoul
 
PPTX
Reactjs
Mallikarjuna G D
 
PDF
[Pgday.Seoul 2020] SQL Tuning
PgDay.Seoul
 
PDF
Object-oriented Programming-with C#
Doncho Minkov
 
PPTX
Express js
Manav Prasad
 
PPT
GRASP Principles
Gianfranco Zas
 
PPTX
ZIO: Powerful and Principled Functional Programming in Scala
Wiem Zine Elabidine
 
PDF
Action Jackson! Effective JSON processing in Spring Boot Applications
Joris Kuipers
 
PDF
JavaScript Programming
Sehwan Noh
 
Introduction to React JS
Arnold Asllani
 
Collections and its types in C# (with examples)
Aijaz Ali Abro
 
Get to know PostgreSQL!
Oddbjørn Steffensen
 
Clean code
Arturo Herrero
 
MySQL Atchitecture and Concepts
Tuyen Vuong
 
Basic SQL
Durgesh Tripathi
 
PostgreSQL Tutorial For Beginners | Edureka
Edureka!
 
JavaScript - Chapter 9 - TypeConversion and Regular Expressions
WebStackAcademy
 
Getters_And_Setters.pptx
Kavindu Sachinthe
 
CSS3 Media Queries
Russ Weakley
 
A brief introduction to SQLite PPT
JavaTpoint
 
[Pgday.Seoul 2018] 이기종 DB에서 PostgreSQL로의 Migration을 위한 DB2PG
PgDay.Seoul
 
[Pgday.Seoul 2020] SQL Tuning
PgDay.Seoul
 
Object-oriented Programming-with C#
Doncho Minkov
 
Express js
Manav Prasad
 
GRASP Principles
Gianfranco Zas
 
ZIO: Powerful and Principled Functional Programming in Scala
Wiem Zine Elabidine
 
Action Jackson! Effective JSON processing in Spring Boot Applications
Joris Kuipers
 
JavaScript Programming
Sehwan Noh
 

Similar to CRUD Operations Development (20)

PPTX
CRUD presentation of laravel application.pptx
ShoukatRiaz
 
PDF
Web Programming - 9 Create, Read, Update and Delete
AndiNurkholis1
 
PPTX
Building Large Scale PHP Web Applications with Laravel 4
Darwin Biler
 
PDF
Object Oriented Programming with Laravel - Session 6
Shahrzad Peyman
 
PDF
Building Scalable Applications with Laravel
Muhammad Shakeel
 
PPTX
Laravel overview
Obinna Akunne
 
PDF
Laravel 4 presentation
Abu Saleh Muhammad Shaon
 
PDF
Getting to know Laravel 5
Bukhori Aqid
 
PPTX
Laravel
Dyuti Islam
 
PPTX
What-is-Laravel and introduciton to Laravel
PraveenHegde20
 
PPTX
Introduction to laravel framework
Ahmad Fatoni
 
PPTX
Software Development with PHP & Laravel
Juan Victor Minaya León
 
PDF
RESTful API development in Laravel 4 - Christopher Pecoraro
Christopher Pecoraro
 
PPTX
A introduction to Laravel framework
Phu Luong Trong
 
PDF
laravel-interview-questions.pdf
AnuragMourya8
 
PPTX
Eloquent workflow: delivering data from database to client in a right way
Роман Кинякин
 
PDF
Laravel 101
Commit University
 
PDF
Laravel Web Development: A Comprehensive Guide
deep9753ak
 
PDF
Web application development with laravel php framework version 4
Untung D Saptoto
 
PDF
Why is crud a bad idea - focus on real scenarios
Divante
 
CRUD presentation of laravel application.pptx
ShoukatRiaz
 
Web Programming - 9 Create, Read, Update and Delete
AndiNurkholis1
 
Building Large Scale PHP Web Applications with Laravel 4
Darwin Biler
 
Object Oriented Programming with Laravel - Session 6
Shahrzad Peyman
 
Building Scalable Applications with Laravel
Muhammad Shakeel
 
Laravel overview
Obinna Akunne
 
Laravel 4 presentation
Abu Saleh Muhammad Shaon
 
Getting to know Laravel 5
Bukhori Aqid
 
Laravel
Dyuti Islam
 
What-is-Laravel and introduciton to Laravel
PraveenHegde20
 
Introduction to laravel framework
Ahmad Fatoni
 
Software Development with PHP & Laravel
Juan Victor Minaya León
 
RESTful API development in Laravel 4 - Christopher Pecoraro
Christopher Pecoraro
 
A introduction to Laravel framework
Phu Luong Trong
 
laravel-interview-questions.pdf
AnuragMourya8
 
Eloquent workflow: delivering data from database to client in a right way
Роман Кинякин
 
Laravel 101
Commit University
 
Laravel Web Development: A Comprehensive Guide
deep9753ak
 
Web application development with laravel php framework version 4
Untung D Saptoto
 
Why is crud a bad idea - focus on real scenarios
Divante
 
Ad

Recently uploaded (20)

PPTX
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
PDF
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
PDF
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
PDF
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
PPTX
Comprehensive Risk Assessment Module for Smarter Risk Management
EHA Soft Solutions
 
PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
PPTX
Coefficient of Variance in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PDF
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PPTX
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
PPTX
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
Technical-Careers-Roadmap-in-Software-Market.pdf
Hussein Ali
 
PPTX
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
PDF
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
Comprehensive Risk Assessment Module for Smarter Risk Management
EHA Soft Solutions
 
Tally software_Introduction_Presentation
AditiBansal54083
 
Coefficient of Variance in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Technical-Careers-Roadmap-in-Software-Market.pdf
Hussein Ali
 
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
Ad

CRUD Operations Development

  • 1. Laravel The PHP Framework For Web Artisans CRUD Operations Development By Chen Alon
  • 2. What is the acronym CRUD? In computer programming, Create, Read, Update, and Delete are the four basic functions of persistent storage. Operation SQL REST API HTTP Create INSERT .../resource PUT / POST Read (Retrieve) SELECT .../resource/{id} | .../resource/{id}/resource GET Update (Modify) UPDATE .../resource/{id} | .../resource/{id}/resource PUT / POST / PATCH Delete (Destroy) DELETE .../resource/{id} | .../resource/{id}/resource DELETE
  • 3. How you manage your CRUD operations?
  • 4. An old project - managing CRUD operations Do you see any problems? Problems: 1. The controller class depends on Eloquent. 2. It’s VERY hard to change the data access layer. 3. Breaks the DRY principle 4. Adds responsibility to the controller. 5. Breaks the SOLID principles.
  • 5. So, how should we manage our CRUD? (1) Use the Repository Design Pattern
  • 6. So, how should we manage our CRUD? (2) Follow the Don’t Repeat Yourself principle The User Controller The User API Controller
  • 7. So, how should we manage our CRUD? (3) Follow the Dependency Inversion principle Eloquent Implementation MongoDB Implementation
  • 8. Summary & Resources 1) Use the Repository Design Pattern Decouple the data layer from the business logic. 2) Follow the Don’t Repeat Yourself principle Make sure your CRUD operations are available to use across the application. 3) Follow the Dependency Inversion principle (and SOLID in general) Make sure you can switch your data layer easily. Today you want to use Eloquent with MySQL, Tomorrow you will have to switch to MongoDB. Resources ● https://github.com/andersao/l5-repository/ ● https://bosnadev.com/2015/03/07/using-repository-pattern-in-laravel-5/ ● https://medium.com/beyond-the-manifesto/why-the-repository-pattern-is-ofte n-misunderstood-in-the-laravel-community-e840780499f2