Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error seeding database #10

Open
bellwood opened this issue Dec 4, 2017 · 4 comments
Open

Error seeding database #10

bellwood opened this issue Dec 4, 2017 · 4 comments

Comments

@bellwood
Copy link

bellwood commented Dec 4, 2017

 Create Roles for user, default is admin and user? [y|N] (yes/no) [yes]:
 >

 Enter roles in comma separate format. [Admin,User]:
 >
In Connection.php line 664:

  SQLSTATE[23000]: Integrity constraint violation: 19 NOT NULL constraint failed: roles.guard_name (SQL: insert into "roles" ("name", "updated_at", "created_at") values (Admin, 2017-12-04 13:12:50, 2017-12-04 13:12:50))


In Connection.php line 458:

  SQLSTATE[23000]: Integrity constraint violation: 19 NOT NULL constraint failed: roles.guard_name

Edit:

Laravel 5.5.22
PHP 7.0.15

Following the blog article

@diorz38
Copy link
Contributor

diorz38 commented Jul 16, 2018

just fill:

Enter roles in comma separate format. [Admin,User]:
 >Admin,User,Author

and press enter

@bellwood
Copy link
Author

I think the issue is that [Admin,User] implies it will be the default if you just hit enter, perhaps catch null input or make those the defaults if just enter is given?

@ManojKiranA
Copy link

 Create Roles for user, default is admin and user? [y|N] (yes/no) [yes]:
 >

 Enter roles in comma separate format. [Admin,User]:
 >
In Connection.php line 664:

  SQLSTATE[23000]: Integrity constraint violation: 19 NOT NULL constraint failed: roles.guard_name (SQL: insert into "roles" ("name", "updated_at", "created_at") values (Admin, 2017-12-04 13:12:50, 2017-12-04 13:12:50))


In Connection.php line 458:

  SQLSTATE[23000]: Integrity constraint violation: 19 NOT NULL constraint failed: roles.guard_name

Edit:

Laravel 5.5.22
PHP 7.0.15

Following the blog article

While the issues is occured

Enter roles in comma separate format. [Admin,User]: Enter the list of roles used in your application such as Admin,User,Editor,Publisher

@SanthoshSiddegowda
Copy link

SanthoshSiddegowda commented Apr 8, 2019

In App/Providers/AppServiceProvider.php

use below code

<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        Schema::defaultStringLength(191);
    }

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants