#1 India's Top IT Training Institute

×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →

Creating, Reading, Updating, and Deleting Records (CRUD)

Almost every feature in a web application eventually comes down to CRUD: creating, reading, updating, and deleting records. Eloquent makes each of these operations concise, replacing what would otherwise be several lines of raw SQL with simple, expressive method calls.

Creating Records

New records can be created by instantiating a model and calling save(), or more concisely using the create() method, which accepts an array of attributes in one step. Mass assignment through create() requires the relevant fields to be listed in the model's $fillable property, as a safeguard against unintended data changes.

Reading Records

Eloquent offers a range of methods for retrieving data, from fetching a single record by its primary key to building complex, filtered queries using the underlying query builder.

Updating and Deleting Records

OperationCommon Method
CreateModel::create([...])
Read (single)Model::find($id)
Read (all)Model::all() or Model::where(...)->get()
Update$model->update([...])
Delete$model->delete()

These CRUD operations depend entirely on a table already existing with the right structure — which is exactly what migrations are responsible for creating and running.

Ready to master Laravel Training Course?

Join Uncodemy's hands-on Laravel program and build real, production-ready applications.

Explore Course