Bladephp: Now with 7+ codeigniter, php, and laravel project 7+ php project From $18/Year From Rs. 1000/Year

How to use Insert Statement in Laravel 5

mysql laravel
How to use Insert Statement in Laravel 5

We can insert the record using the DB facade with execute an insert statement. This method takes the raw SQL query as its first argument and bindings as its second argument.

Let’s create an insert Statement in laravel 5

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

class PostController extends Controller
    public function InsertData()
        DB::insert('insert into post (title, slug) values (?, ?)', ["Laravel", 'laravel']);


Html code work in comment box

Related Post