title: Laravel "SQLSTATE[HY000]: General error: 1364 Field 'Login' doesn't have a default value..."
body: <p>I was having this issue after trying all existing solutions from other threads none works, like this one : <a href="https://stackoverflow.com/questions/18751291/mysql-error-1364-field-display-name-doesnt-have-default-value">MySql Error: 1364 Field &#39;display_name&#39; doesn&#39;t have default value</a> if i do <code>-&gt;nullable()</code> all my inserts would be empty.
  thats my code :</p>
  
  <p>The controller:</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers;
  use App\Utilisateur;
  
  use Illuminate\Http\Request;
  
  class UtilisateursController extends Controller
  {
      /**
       * Display a listing of the resource.
       *
       * @return \Illuminate\Http\Response
       */
      public function index()
      {
          //
      }
  
      /**
       * Show the form for creating a new resource.
       *
       * @return \Illuminate\Http\Response
       */
      public function create()
      {
          return view('login.create');
      }
  
      /**
       * Store a newly created resource in storage.
       *
       * @param  \Illuminate\Http\Request  $request
       * @return \Illuminate\Http\Response
       */
      public function store(Request $request)
      {
          $this-&gt;validate($request, [
              'username' =&gt; 'required',
              //'email' =&gt; 'required',
              'password' =&gt; 'required',
              //'password_confirmation' =&gt; 'required',
              //'telephone' =&gt; 'required'
            ]);
            $inscription = new Utilisateur([
              'Login' =&gt; $request-&gt;get('username'),
              'E-mail' =&gt; 'email',
              'Password' =&gt; $request-&gt;get('password'),
              'Telephone' =&gt; 'telephone',
              'created_at' =&gt; $request-&gt;get(date("Y-m-d H:i:s")),
              'updated_at' =&gt; $request-&gt;get(date("Y-m-d H:i:s"))
            ]);
            $inscription-&gt;save();
            return redirect()-&gt;route('login.create')-&gt;with('success', 'inscription réussite');
      }
  
      /**
       * Display the specified resource.
       *
       * @param  int  $id
       * @return \Illuminate\Http\Response
       */
      public function show($id)
      {
          //
      }
  
      /**
       * Show the form for editing the specified resource.
       *
       * @param  int  $id
       * @return \Illuminate\Http\Response
       */
      public function edit($id)
      {
          //
      }
  
      /**
       * Update the specified resource in storage.
       *
       * @param  \Illuminate\Http\Request  $request
       * @param  int  $id
       * @return \Illuminate\Http\Response
       */
      public function update(Request $request, $id)
      {
          //
      }
  
      /**
       * Remove the specified resource from storage.
       *
       * @param  int  $id
       * @return \Illuminate\Http\Response
       */
      public function destroy($id)
      {
          //
      }
  }
  </code></pre>
  
  <p>The model:</p>
  
  <pre><code>    &lt;?php
  
  namespace App;
  
  use Illuminate\Database\Eloquent\Model;
  
  class Utilisateur extends Model
  {
      protected $fillable = ['username', 'email', 'password', 'telephone'];
  }
  </code></pre>
  
  <p>The database:</p>
  
  <pre><code>&lt;?php
  
  use Illuminate\Support\Facades\Schema;
  use Illuminate\Database\Schema\Blueprint;
  use Illuminate\Database\Migrations\Migration;
  
  class CreateUtilisateursTable extends Migration
  {
      /**
       * Run the migrations.
       *
       * @return void
       */
      public function up()
      {
          Schema::create('utilisateurs', function (Blueprint $table) {
              $table-&gt;increments('ID-User');
              $table-&gt;string('Login', 250);
              $table-&gt;string('Password', 250);
              $table-&gt;string('Telephone', 250);
              $table-&gt;string('E-mail', 250)-&gt;unique();
              $table-&gt;timestamps();
          });
      }
  
      /**
       * Reverse the migrations.
       *
       * @return void
       */
      public function down()
      {
          Schema::dropIfExists('utilisateurs');
      }
  }
  </code></pre>