kodeine / laravel-acl

Light-weight role-based permissions system for Laravel 6+ built in Auth system.
MIT License
787 stars 217 forks source link

Need fix foreign key table name #246

Open chiricomarco opened 4 years ago

chiricomarco commented 4 years ago

In this file: /src/migrations/2015_02_07_172633_create_role_user_table.php - need to change the follow part of code:

before: $table->foreign('user_id') ->references('id') ->on() ->onDelete('cascade');

after: $table->foreign('user_id') ->references('id') ->on($this->prefix . 'users') ->onDelete('cascade');

Cheers Marco

SnusnumrConceit commented 4 years ago

@chiricomarco thnx man! You're saved my time!

developerdelphi commented 4 years ago

Hey guys. I have too add in the file: /src/migrations/2015_02_17_152439_create_permission_user_table I verify in database and don't relashions key in the tables. ... $table->foreign('permission_id') ->references('id') ->on($this->prefix . 'permissions') ->onDelete('cascade'); $table->foreign('user_id') ->references('id') ->on($this->prefix . 'users') ->onDelete('cascade');

GiTsu commented 4 years ago

problem still exists on fresh v6.0 installation. laravel-acl version = 2.0.3. I had to manually edit migration file in vendor dir

kodeine commented 4 years ago

@GiTsu, @chiricomarco can you please submit the PR?