Illuminate\Database\QueryException SQLSTATE[23000]: Integrity constraint violation: 19 NOT NULL constraint failed: users.email (SQL: INSERT INTO users (name) VALUES (rtefadsfasdf))
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use DB;
class HomeController extends Controller
{
public function index()
{
$title = 'Primeiro Projeto Laravel';
return view('home.banner')->with('title', $title);
}
public function store(Request $request)
{
$nameUser = $request->input('name');
if(DB::insert('INSERT INTO users (name) VALUES (?)',[$nameUser])){
return 'OK';
}else{
return 'ERROR INSERT NOT WORK';
}
}
}
eu nao mudei a tabela como vc fez, eu só usei ja o que vinha a tabela de usuários