Initial commit
This commit is contained in:
34
database/migrations/2025_05_02_092726_seed_initial_table.php
Normal file
34
database/migrations/2025_05_02_092726_seed_initial_table.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use App\Models\Homepage;
|
||||
use App\Models\Link;
|
||||
use App\Models\Size;
|
||||
use App\Models\Footer;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Homepage::firstOrCreate(['photo' => null, 'title' => null, 'body' => null, 'address' => null, 'opening_hours' => null, 'widget_link' => null]);
|
||||
Link::firstOrCreate(['links' => null]);
|
||||
Size::firstOrCreate(['small' => null, 'small_photo' => null, 'medium' => null, 'medium_photo' => null, 'large' => null, 'large_photo' => null]);
|
||||
Footer::firstOrCreate(['links' => null]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Homepage::where('id', 1)->delete();
|
||||
Link::where('id', 1)->delete();
|
||||
Size::where('id', 1)->delete();
|
||||
Footer::where('id', 1)->delete();
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user