خرید بک لینک

Vote count: 0

I am new to laravel please give the solution This is user controller code when i submit the form i am getting email is null but i am inserting email.

there is no laravel issue i think its mysql issue

<?php
namespace ApphttpControllers;

  use AppUser;
  use IlluminateHttpRequest;

     class UserController extends Controller
{
   public function postSignUp(Request $request)
   {
     $email = $request['email'];
     $first_name = $request['first_name'];
     $password = bcrypt($request['password']);

     $user = new User();
     $user->email = $email;
     $user->first_name = $first_name;
     $user->password = $password;

     $user-> save();

     return redirect()-> back();
   }

     public function postSignIn(Request $request)
   {
   }

   }

This is migrate table.

<?php

 use IlluminateDatabaseSchemaBlueprint;
  use IlluminateDatabaseMigrationsMigration;

  class CreateUsersTable extends Migration
   {
/**
 * Run the migrations.
 *
 * @return void
 */
public function up()
{
    Schema::create('users', function (Blueprint $table) {
        $table->increments('id');
        $table->timestamps();
        $table->string('email');
        $table->string('first_name');
        $table->string('password');
        $table->rememberToken();
    });
}

/**
 * Reverse the migrations.
 *
 * @return void
 */
public function down()
{
    Schema::drop('users');
    }
 }

asked 12 secs ago

برچسب: sqlstate 23000 integrity constraint violation 1048 column 'email' caot be null, نویسنده: استخدام کار تاريخ: يکشنبه 7 شهريور 1395 ساعت: 18:25

صفحه بندی