я 2 таблицы созданы следующим образом:На удаление: каскад не работает
Schema::create('educations', function(Blueprint $table){
$table->increments('id');
$table->string('title');
$table->date('from_date');
$table->date('to_date');
$table->string('summary');
$table->integer('cv_id')->unsigned();
$table->foreign('cv_id')->references('id')
->on('cvs')
->onDelete('cascade')
->onUpdate('cascade');
$table->timestamps();
});
И они связаны с другой таблицей:
Schema::create('cvs', function(Blueprint $table){
$table->increments('id');
$table->integer('student_id')->unsigned();
$table->foreign('student_id')->references('id')
->on('students')
->onDelete('cascade')
->onUpdate('cascade');
$table->string('summary');
$table->timestamps();
});
Проблема в том, когда я называю эту линию :
$student->cv->delete();
Он упадет cv, но не другие атрибуты в связанных с ним таблицах.
Что мне не хватает?
Вы используете SQLite? –
Я использую mySQL –