hootlex/laravel-friendships

Incorrect table name '' When making migrations.

Opened this issue · 3 comments

I've used make:migrations to create "create_friendships_table" and "create_friendships_groups_table". I copy and paste the code from github into these files and I get these errors and I can't figure it out.

[Illuminate\Database\QueryException]
SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name '' (SQL: create table `` (friendship_id int unsigned not null, `fr
iend_id` int unsigned not null, `friend_type` varchar(255) not null, `group_id` int unsigned not null) default character set utf8mb4 collate utf8
mb4_unicode_ci)

[PDOException]
SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name ''

Hello @bknetmedia !

I suspect the issue to be that you manually created "create_friendships_table" and "create_friendships_groups_table", I obviously don't know how familliar you are with Laravel, but usually, config file and migrations like that should always be imported with php artisan vendor:publish or with php artisan vendor:publish --provider="Hootlex\Friendships\FriendshipsServiceProvider" in the case of this package as stated in the documentation.

Let me know if you still have issues after that, I would be happy to help

I'll try that today. I just did php migrations and typed everything into the file.

Ok this worked for me. Any idea on how to build a controller for this project?