It not work, I search so many ways, How can I change length of value in laravel 5
public function up() { Schema::table('articles', function (Blueprint $table) { $table->string('name',50)->change(); }); }
Thank you all for reading!
To modify a column with a foreign key constraint, you'll have to use alter table [table] modify (i.e. DB::statement('alter table [table] modify [column] [changes]');).
$table->unique('slug'); So you add unique index to existing 'slug'.
Following worked for me. Definitely you need to install doctrine/dbal to make this work, using following command in terminal. open your migration file and write down below. Schema::table('yourTable', function (Blueprint $table) { $table->string('column_name','4294967295')->change(); });
Regarding documentation, your example should work:
Schema::table('users', function ($table) { $table->string('name', 50)->change(); });
Just run php artisan migrate
command to execute it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With