v1.2.0 - You can now create and edit guides
This commit is contained in:
@@ -18,6 +18,7 @@ class CreateGuidesTable extends Migration
|
||||
$table->timestamps();
|
||||
$table->string('name')->unique();
|
||||
$table->longText('guide_articles');
|
||||
$table->foreignId('guide_category_id')->nullable()->constrained('guides_categories', 'id');
|
||||
$table->foreignId('resource_id')->nullable()->constrained('resources', 'id');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -19,5 +19,6 @@ class DatabaseSeeder extends Seeder
|
||||
$this->call(WashingMachineSeeder::class);
|
||||
$this->call(NewsTypeSeeder::class);
|
||||
$this->call(ResourceCategorySeeder::class);
|
||||
$this->call(GuidesCategoriesSeeder::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class GuidesCategoriesSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$GuidesCategoriesdata = [
|
||||
[
|
||||
'guidesCategoryName' => 'Ingen Kategori'
|
||||
]
|
||||
];
|
||||
|
||||
foreach ($GuidesCategoriesdata as $data) {
|
||||
$GuidesCategory = new \App\GuidesCategory();
|
||||
|
||||
$GuidesCategory->guidesCategoryName = $data["guidesCategoryName"];
|
||||
|
||||
$GuidesCategory->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user