Anyone have source Code of this game?
and did you use migrate ?
do you know debugging ?
Anybody with the same error?
What is the problem in changing the file position?
why do you need so many uuid ?
Anyone have source Code of this game?
{
$this->call(UsersTableSeeder::class);
$this->call(PostsTableSeeder::class);
$this->call(TagsTableSeeder::class);
//TODO join tags and posts
$posts = Post::all();
Tag::get()->each(function ($tag) use ($posts){
$tag->posts()->attach($posts->pluck(‘id’));
});
}
public function up()
{
Schema::create(‘posts_tags’, function (Blueprint $table) {
$table->id();
$table->BigInteger(‘posts_id’);
$table->BigInteger(‘tags_id’);
$table->timestamps();
});
}
public function up()
{
Schema::create(‘posts_tags’, function (Blueprint $table) {
$table->id();
$table->BigInteger(‘posts_id’);
$table->BigInteger(‘tags_id’);
$table->timestamps();
});
}
public function posts()
{
return $this->belongsToMany(Post::class);
}
{
return $this->belongsToMany(Tag::class);
}
i have done dump autoload still I am getting the same error
Tag::get()->each(function ($tag) use ($posts){
dd($tag, $posts);
$tag->posts()->attach($posts->pluck(‘id’));
});


[stacktrace]
Anyone know how to make the website fast
Actually my website has data upto lakhs
So the page load very slowly
????? I have used Vue is as frontend and code igniter as backend
> add foreign key FK_notific_id: notification (notification_id) references notification (id) …Exception: SQLSTATE[HY000]: General error: 3780 Referencing column ‘notification_id’ and referenced column ‘id’ in foreign key constraint ‘FK_notific_id’ are incompatible.
What is the problem in changing the file position?
IlluminateDatabaseQueryException : SQLSTATE[42P07]: Duplicate table: 7 ERROR: relation “users” already exists (SQL: create table “users” (“id” uuid not null, “firstname” varchar(100) not null, “lastname” varchar(200) null, “email” varchar(200) not null, “company_id” uuid not null, “username” varchar(200) not null, “password” varchar(255) not null, “email_verified_at” timestamp(0) without time zone null, “remember_token” varchar(255) not null, “created_at” timestamp(0) with time zone null, “updated_at” timestamp(0) with time zone null, “deleted_at” timestamp(0) with time zone null))
And My migration are the following
<?php
use IlluminateDatabaseMigrationsMigration;
use IlluminateDatabaseSchemaBlueprint;
use IlluminateSupportFacadesSchema;
class Users extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create(‘users’, function (Blueprint $table) {
$table->uuid(‘id’)->primary();
$table->string(‘firstname’, 100);
$table->string(‘lastname’, 200)->nullable();
$table->string(’email’, 200)->unique();
$table->uuid(‘company_id’);
$table->string(‘username’, 200)->unique();
$table->string(‘password’, 255);
$table->dateTime(’email_verified_at’)->nullable();
$table->string(‘remember_token’, 255);
$table->timestampsTz();
$table->softDeletesTz();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists(‘users’);
}
}
IlluminateDatabaseQueryException : SQLSTATE[42P07]: Duplicate table: 7 ERROR: relation “users” already exists (SQL: create table “users” (“id” uuid not null, “firstname” varchar(100) not null, “lastname” varchar(200) null, “email” varchar(200) not null, “company_id” uuid not null, “username” varchar(200) not null, “password” varchar(255) not null, “email_verified_at” timestamp(0) without time zone null, “remember_token” varchar(255) not null, “created_at” timestamp(0) with time zone null, “updated_at” timestamp(0) with time zone null, “deleted_at” timestamp(0) with time zone null))
And My migration are the following
<?php
use IlluminateDatabaseMigrationsMigration;
use IlluminateDatabaseSchemaBlueprint;
use IlluminateSupportFacadesSchema;
class Users extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create(‘users’, function (Blueprint $table) {
$table->uuid(‘id’)->primary();
$table->string(‘firstname’, 100);
$table->string(‘lastname’, 200)->nullable();
$table->string(’email’, 200)->unique();
$table->uuid(‘company_id’);
$table->string(‘username’, 200)->unique();
$table->string(‘password’, 255);
$table->dateTime(’email_verified_at’)->nullable();
$table->string(‘remember_token’, 255);
$table->timestampsTz();
$table->softDeletesTz();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists(‘users’);
}
}
if you dont have data on your tables, try to do php artisan migrate:fresh
Invalid foreign key: 7 ERROR: there is no unique constraint matching given keys for referenced table “user_actions” (SQL: alter table “group_policies” add constraint “fk_action_id” foreign key (“action_id”) references “user_actions” (“id”))
the user_actions migration is:
class UserActions extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create(‘user_actions’, function (Blueprint $table) {
$table->uuid(‘id’);
$table->string(‘name’, 100);
$table->string(‘description’, 200);
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists(‘user_actions’);
}
}
and the group_policies migration file is, the following, where the error appears:
class GroupPolicies extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create(‘group_policies’, function (Blueprint $table) {
$table->uuid(‘id’);
$table->uuid(‘group_id’);
$table->uuid(‘resource_id’);
$table->uuid(‘action_id’);
$table->timestamps();
$table->softDeletes();
$table->foreign(‘group_id’, ‘fk_group_id’)
->references(‘id’)
->on(‘groups’);
$table->foreign(‘action_id’, ‘fk_action_id’)
->references(‘id’)
->on(‘user_actions’);
$table->index(
[‘group_id’, ‘resource_id’,’action_id’],
‘group_resource_action_idx’
);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table(‘group_policies’, function (Blueprint $table) {
$table->dropForeign(‘group_id’);
$table->dropForeign(‘action_id’);
});
Schema::dropIfExists(‘group_policies’);
}
}
Invalid foreign key: 7 ERROR: there is no unique constraint matching given keys for referenced table “user_actions” (SQL: alter table “group_policies” add constraint “fk_action_id” foreign key (“action_id”) references “user_actions” (“id”))
the user_actions migration is:
class UserActions extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create(‘user_actions’, function (Blueprint $table) {
$table->uuid(‘id’);
$table->string(‘name’, 100);
$table->string(‘description’, 200);
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists(‘user_actions’);
}
}
and the group_policies migration file is, the following, where the error appears:
class GroupPolicies extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create(‘group_policies’, function (Blueprint $table) {
$table->uuid(‘id’);
$table->uuid(‘group_id’);
$table->uuid(‘resource_id’);
$table->uuid(‘action_id’);
$table->timestamps();
$table->softDeletes();
$table->foreign(‘group_id’, ‘fk_group_id’)
->references(‘id’)
->on(‘groups’);
$table->foreign(‘action_id’, ‘fk_action_id’)
->references(‘id’)
->on(‘user_actions’);
$table->index(
[‘group_id’, ‘resource_id’,’action_id’],
‘group_resource_action_idx’
);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table(‘group_policies’, function (Blueprint $table) {
$table->dropForeign(‘group_id’);
$table->dropForeign(‘action_id’);
});
Schema::dropIfExists(‘group_policies’);
}
}
which package is it and for what I am interested π