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

Unable to install new demo #20

Open
LARAVELNEWEY opened this issue Aug 7, 2020 · 1 comment
Open

Unable to install new demo #20

LARAVELNEWEY opened this issue Aug 7, 2020 · 1 comment

Comments

@LARAVELNEWEY
Copy link

Hello, i found 3 problems on the new demo.
On the posts tables, the author_id is not defined as unsigned so when the migration tries to create the foreign key fails
public function up() { Schema::table('posts', function (Blueprint $table) { $table->integer('author_id')->nullable(); $table->foreign('author_id')->references('id')->on('authors')->onDelete('cascade'); }); }
it can be solved just changing the function to
public function up() { Schema::table('posts', function (Blueprint $table) { $table->integer('author_id')->unsigned()->nullable(); $table->foreign('author_id')->references('id')->on('authors')->onDelete('cascade'); }); }

Same error on articles with relationships table, with the field author_id
The last one is articles_with_relationships_tags table, the foreign key name is too long (max is 64 characteres).
This one can be solved just passing the key name as a second parameter to the foreign method

@alexconrad
Copy link
Contributor

i created a pull request with the changes
https://github.com/BRACKETS-by-TRIAD/craftable-demo/pull/21/files

and another fix as i got
mb_strtoupper() expects at most 2 parameters, 3 given
when trying to create new article with relationship

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

2 participants