Level 33
I prefer #1, but simply go with #2 😆
Seriously, constrains keep your data consistent, you shouldn't neglect them.
When creating schemas and foreign keys, do you prefer the following:
$table->foreignId('category_id')->nullable()->constrained('categories')->onDelete('cascade');
Or do you simply go with:
$table->unsignedBigInteger('category_id')->index();
And then manually handle it through models?
Please or to participate in this conversation.