fix key and add seeder
This commit is contained in:
parent
c5a6cc2426
commit
94d6cbbca7
|
|
@ -10,8 +10,8 @@ class AddServiceRequest extends BaseFormRequest
|
|||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'title' => ['required', 'string', 'max:255'],
|
||||
'description' => ['required', 'string', 'max:255'],
|
||||
'title' => ['required', 'string', 'max:1000'],
|
||||
'description' => ['required', 'string', 'max:1000'],
|
||||
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ class EditServiceRequest extends FormRequest
|
|||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'title' => ['nullable', 'string', 'max:255'],
|
||||
'description' => ["nullable", 'string', 'max:255'],
|
||||
'title' => ['nullable', 'string', 'max:1000'],
|
||||
'description' => ["nullable", 'string', 'max:1000'],
|
||||
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@
|
|||
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Models\key;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
|
|
@ -17,6 +19,16 @@ public function run(): void
|
|||
{
|
||||
// \App\Models\User::factory(10)->create();
|
||||
|
||||
// setting,about_us,contact_us,home
|
||||
|
||||
|
||||
// home_description
|
||||
// home_main_image
|
||||
// about_us_description
|
||||
// contact_us_title
|
||||
// links
|
||||
// about_us_title
|
||||
// about_us_description
|
||||
|
||||
// php artisan db:seed
|
||||
User::create([
|
||||
|
|
@ -24,5 +36,9 @@ public function run(): void
|
|||
"password"=>Hash::make("12345678"),
|
||||
"name"=>"Super Admin"
|
||||
]);
|
||||
$this->call([
|
||||
KeysSeeder::class,
|
||||
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
55
database/seeders/KeysSeeder.php
Normal file
55
database/seeders/KeysSeeder.php
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Key;
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class KeysSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
|
||||
$keys = [
|
||||
[
|
||||
'key' => 'home_description',
|
||||
'value' => 'Home page description',
|
||||
'type' => 'home',
|
||||
],
|
||||
[
|
||||
'key' => 'home_main_image',
|
||||
'value' => '/',
|
||||
'type' => 'home',
|
||||
],
|
||||
[
|
||||
'key' => 'about_us_title',
|
||||
'value' => 'About Us',
|
||||
'type' => 'about_us',
|
||||
],
|
||||
[
|
||||
'key' => 'about_us_description',
|
||||
'value' => 'about_us_description',
|
||||
'type' => 'about_us',
|
||||
],
|
||||
[
|
||||
'key' => 'contact_us_title',
|
||||
'value' => 'Contact Us',
|
||||
'type' => 'contact_us',
|
||||
],
|
||||
[
|
||||
'key' => 'links',
|
||||
'value' => "links",
|
||||
'type' => 'setting',
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($keys as $key) {
|
||||
Key::create($key);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user