Orderstatus als Model, nicht Enum
This commit is contained in:
1 parent
20767d392f
commit
267872406d
6 files changed
+133
-12
No files matched your search
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
use App\Models\User;
|
||||
use App\Orderstatus;
|
||||
use App\Models\Orderstatus;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
@@ -13,14 +13,13 @@ return new class extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
$orderstatusRegistered = Orderstatus::find("name", "erfasst")->first();
|
||||
Schema::create('orders', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->timestamps();
|
||||
$table->string("name");
|
||||
$table->string("url")->nullable();
|
||||
$table->integer("count")->nullable();
|
||||
$table->foreignidfor(Orderstatus::class)->default($orderstatusRegistered->id);
|
||||
$table->foreignidfor(Orderstatus::class)->default(1);
|
||||
$table->datetime("orderdatetime")->nullable();
|
||||
$table->foreignIdFor(User::class);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user