larael drop foreign key
Schema::table('posts', function (Blueprint $table) {
$table->dropForeign(['category_id']);
});
larael drop foreign key
Schema::table('posts', function (Blueprint $table) {
$table->dropForeign(['category_id']);
});
laravel remove foreign key
$table->dropForeign('posts_user_id_foreign');
laravel migration constrained
Schema::table('posts', function (Blueprint $table) {
$table->foreignId('user_id')->constrained();
});
/* The foreignId method is an alias for unsignedBigInteger while the
* constrained method will use conventions to determine the table and
* column name being referenced. If your table name does not match
* Laravel's conventions, you may specify the table name by passing it
* as an argument to the constrained method:
*/
Schema::table('posts', function (Blueprint $table) {
$table->foreignId('user_id')->constrained('users');
});
laravel migration drop foreign keys
$table->dropIndex(['state']); // Drops index 'geo_state_index'
laravel migration drop foreign keys
$table->dropPrimary('users_id_primary');
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us