Laravel Classroom image

Prashant  Nigam / Student / Web Technology

 
To post your Question Join Classroom
 
Lesson Topics's No:-  First|6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14|
Lessons:-Fluent Query Builder

10.12 Delete
To delete a row (please, not the shoes, they are innocent!) we can use the delete() method with
a where() clause, or simply pass it an id directly to delete a single row. Let’s see these methods
in action.
1 <?php
2
3 DB::table('not_shoes')->where('texture', '=', 'fuzzy')->delete();
Simple. The fuzzy things are now gone!
1 <?php
2
3 DB::table('shoes')->delete($id);NO! Not the hot pink skate shoes. You have obviously learned too much, please keep the
responsibility and power thing in mind. We don’t want any more shoe massacres.
In the next chapter, we will be moving on from sho… Fluent, and taking a look at Eloquent.
Eloquent will allow us to treat our database rows as objects, and provides an elegant.. or eloquent
solution to handling relationships.
I would like to thank Max Schwanekamp for purchasing the book, and also Douglas Grubba who
had the following to say:
Keep up the great work Dayle! A wonderful resource. Thank you to the @laravel
team. @taylorotwell you are really changing the php world.
Thanks Doug! I’m sure Taylor will also be pleased to hear that he is changing the PHP world,
one method at a time!

 

 

 
 
 

Prashant  Nigam

Skills    Laravel

Qualifications :-
Location :-,,,
Description:-
Explore
 

  Students (0)