Код: Выделить всё
$table->id();
$table->foreignId('news_id')
->constrained(table: 'news')
->cascadeOnDelete()
->cascadeOnUpdate();
$table->foreignId('category_id')
->constrained(table: 'categories')
->cascadeOnDelete()
->cascadeOnUpdate();
$table->timestamps();

Подробнее здесь: https://stackoverflow.com/questions/782 ... -up-in-sql
Мобильная версия