Top "Laravel-migrations" questions

Database Migrations in Laravel are the way to create and alter database schema.

naming tables in many to many relationships laravel

I concerned about auto naming tables in many-to-many Laravel relationship. for example: Schema::create('feature_product', function (Blueprint $table) {} when …

php laravel laravel-5 eloquent laravel-migrations
Laravel 5.1 Migration and Seeding Cannot truncate a table referenced in a foreign key constraint

I'm trying to run the migration (see below) and seed the database, but when I run php artisan migrate --seed …

mysql laravel laravel-5 laravel-migrations laravel-seeding
How to convert Laravel migrations to raw SQL scripts?

Developers of my team are really used to the power of Laravel migrations, they are working great on local machines …

sql laravel laravel-migrations
How to set default DateTime() in Laravel migrations?

I am trying to achieve the functionality illustrated below: $table->dateTime('time')->default(new \DateTime()); This exact …

laravel laravel-migrations
How to seed database migrations for laravel tests?

Laravel's documentation recommends using the DatabaseMigrations trait for migrating and rolling back the database between tests. use Illuminate\Foundation\Testing\…

php laravel testing laravel-migrations laravel-seeding
How to drop softDeletes from a table in a migration

I'm adding the soft delete columns to my table in a migration: public function up() { Schema::table("users", function ($table) { $…

php database laravel laravel-migrations
Available actions for onUpdate / onDelete in Laravel 5.x

As mentioned in here, we can use the word cascade when making a relation in migrations but I wonder they …

laravel laravel-5 laravel-migrations
Laravel Migration: Add a column with a default value of an existing column

i need to add a last_activity column on a table of a live site where i have to make …

laravel laravel-5 laravel-5.1 laravel-migrations
Laravel migration boolean field created in Db like tiny integer

I wrote a migration in Laravel: Schema::create('test', function (Blueprint $table) { // $table->increments('id'); $table->string('city',…

php laravel laravel-migrations
How do Laravel migrations work?

I'm totally new to this type of framework. I've come from barebones PHP development and I can't seem to find …

php laravel laravel-5 laravel-migrations