YouTube Icon

Code Playground.

How to use Delete Statement in Laravel 5

CFG

How to use Delete Statement in Laravel 5

Using the DB disguise, we can delete the record by executing a delete statement (remove the record from the database). Like update, it will return the number of rows affected by the comment.

Let's build a laravel 5 delete statement

namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use DB;

class PostController extends Controller
{
    public function DeleteData()
    {
         DB::delete('delete from post');    
    }
}




CFG