Search
 
SCRIPT & CODE EXAMPLE
 

PHP

cascade in laravel migration

$table->dropForeign('answers_user_id_foreign');
$table->foreign('user_id')
->references('id')->on('users')
->onDelete('cascade');
Comment

cascade laravel

Schema::create('posts', function (Blueprint $table) {
    $table->id();
    $table->foreignId('author')->constrained('users')->onDelete('cascade')->onUpdate('cascade');
    $table->timestamps();
});
Comment

how work cascade laravel

Schema::create('posts', function (Blueprint $table) {
    $table->increments('id');
    $table->integer('author')->unsigned();
    $table->timestamps();
    $table->foreign('author')->references('id')->on('users')->onUpdate('cascade');
});
Comment

PREVIOUS NEXT
Code Example
Php :: laravel db seed specific class 
Php :: laravel test assert redirecto to 
Php :: display category name wordpress 
Php :: php loop through array 
Php :: uninstall php 8.0 ubuntu 
Php :: install php 7.3 on amazon linux 2 
Php :: init hook wordpress 
Php :: check if logged laravel 
Php :: lravel redirect with error 
Php :: home url wordpress 
Php :: laravel session has message 
Php :: laravel parse string to date 
Php :: magento 2 get connection 
Php :: laravel get last record 
Php :: beautify var_dump 
Php :: php artisan migrate --env=testing 
Php :: convert to int laravel 
Php :: laravel 8 bootstrap pagination fix 
Php :: How to Disable the WordPress JSON REST API Without Plugin 
Php :: php strtotime 1 day ago from 
Php :: wordpress errors 
Php :: php exit foreach 
Php :: setup_postdata not working 
Php :: php utf 8 sqlsrv 
Php :: php artisan make migration 
Php :: magento2 memory limit 
Php :: convert date in php 
Php :: get logged in user name yii2 
Php :: laravel order by 
Php :: excerpt length wordpress 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =