Skip to main content

All Questions

1 vote
2 answers
77 views

How ignore foreign key migration in general?

I have a question about migrations in Laravel. Is it possible to handle foreign keys with a simple if statement? Specifically, I want to ensure that if a foreign key already exists, it should not be ...
JayVch's user avatar
  • 81
0 votes
0 answers
29 views

Foreign key constraint is incorrectly formed | Laravel project

Auctions table class CreateAuctionsTable extends Migration { public function up(): void { Schema::create('auctions', function (Blueprint $table) { $table->id(); ...
404ptk's user avatar
  • 133
0 votes
3 answers
492 views

Laravel Migration - Create model from a SINGLE table in database

(I'm french, I hope you will understand my request ^^). I'm very new on Laravel ! I am making a Laravel app and i've install the Breeze extension to manage connexion. But now I want to include some ...
DeveCout's user avatar
0 votes
2 answers
61 views

Page Refreshing Instead of Storing Values in Database Table on Form Submission in Students Table (Validation is failing)

I am unable to store the value in the database using the register form I have tried different ways like changing routes controllers here is my Student.php model <?php namespace App\Models; use ...
Vishal Kumar's user avatar
0 votes
0 answers
37 views

Foreign key constraint cannot add

SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint (SQL: alter table products add constraint products_brand_id_foreign foreign key (brand_id) references product_brands (id) on ...
xshadow's user avatar
-1 votes
1 answer
296 views

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'wkaranjarealtorsdb.categories' doesn't exist on php artisan migrate

am getting this error when I run PHP artisan migrate when I want to send add the migration tables to the database in my laravel project.already i have created all the migration tables, when I run PHP ...
stephen Weru's user avatar
0 votes
0 answers
346 views

How can I run migration on Heroku Cloud databases(ClearDB) in Laravel

I'm facing a problem on databases migration on Heroku .Im trying to deploy my laravel project with mysql databases using clearDB on Heroku. I have deploy my web app successfully on heroku it work fine ...
WIsh Suharitdamrong's user avatar
-1 votes
2 answers
776 views

laravel 8 manually deleted tables cant be generated from migration [duplicate]

I manually deleted my all tables now i want ot re-migrate my tables. but it shows this error Base table or view not found: 1146 Table 'mymedia.categories' doesn't exist (SQL: select * from categories ...
MicroWeb Technology Ltd's user avatar
0 votes
2 answers
1k views

Add column to all tables through migration in Laravel

As our project scaled we decided that every single data should belong to companies that created them. Therefore I'm to add a column "data_owner_company_id" that points to the company that ...
Skywarth's user avatar
  • 843
0 votes
2 answers
3k views

SQLSTATE[HY000]: General error: 1005 Can't create table `test`.`members` (errno: 150 "Foreign key constraint is incorrectly formed")

I'm using my migrations in Laravel to create the relationships between tables, and I have 4 tables: users, members, member_skills, and skills. I have the following code for the users table: public ...
John Henry Galino's user avatar
-3 votes
1 answer
159 views

While Migrating database it shows error Syntax error or access violation: 1067 Invalid default value for 'domain_status'

I dont know how to resolve this use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateDomainsTable extends ...
Anvita Rastogi's user avatar
0 votes
1 answer
955 views

Incorrect table name

Illuminate\Database\QueryException : SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name '' (SQL: create table `` (id bigint unsigned not null auto_increme nt primary key, ...
Sohaib's user avatar
  • 1,991
2 votes
4 answers
1k views

Separate table for each year in Laravel

How can implement tables based on year in Laravel, like Orders2020, Orders2019, Orders2018 etc. And how to switch between?
Mohsen's user avatar
  • 4,235
0 votes
1 answer
52 views

Cannot add foreign key constraint in Laravel

I have an app where users belong to a team. Here is my test: /** @test */ public function it_has_many_users() { $team = factory(Team::class)->create(); $users = factory(User::class, 3)->...
L. Fox's user avatar
  • 354
-1 votes
1 answer
55 views

Foreign key constraint is incorrectly formed - MariaDB & Laravel

I am running a databse migration in laravel 5.8 and I am getting the following error: Illuminate\Database\QueryException : SQLSTATE[HY000]: General error: 1005 Can't create table cartorque.likes (...
Danny Younes's user avatar

15 30 50 per page