From 2bfd9d0e80644acdff8e627f413d81e8b3823926 Mon Sep 17 00:00:00 2001 From: Yasser Elgammal Date: Tue, 22 Oct 2024 14:59:54 +0300 Subject: [PATCH] Update & Format Code --- README.md | 7 ++++++- app/Models/Post.php | 2 +- database/seeders/DatabaseSeeder.php | 7 ++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7852361..f18cac2 100644 --- a/README.md +++ b/README.md @@ -83,9 +83,14 @@ GET | api/posts/{id} | Show Specific Post 6. Run migrations by executing `php artisan migrate` , Then Run `php artisan db:seed` if you want use faker database records, 7. Start the project by running `php artisan serve` +### Demo Account +- AdminURL: http://127.0.0.1:8000/admin +- Email: admin@example.com +- Password: password + ## About Me -Iam a Junior Backend Developer with one year of experience, I specialize in PHP, Laravel, and front-end technologies like TailwindCSS and Livewire. I have expertise in developing REST APIs and working with MySQL databases, and I am familiar with software architecture patterns such as MVC and HMVC. I am committed to producing clean, well-documented code that is easily maintainable, and I enjoy sharing my knowledge through various channels. I am eager to take on new challenges and continue to develop my skills. +Iam a Backend Developer with 2+ year of experience, I specialize in PHP, Laravel, and front-end technologies like TailwindCSS and Livewire. I have expertise in developing REST APIs and working with MySQL databases, and I am familiar with software architecture patterns such as MVC and HMVC. I am committed to producing clean, well-documented code that is easily maintainable, and I enjoy sharing my knowledge through various channels. I am eager to take on new challenges and continue to develop my skills. - [LinkedIn](https://www.linkedin.com/in/elgammal/). - [Youtube](https://www.youtube.com/@yasser.elgammal). diff --git a/app/Models/Post.php b/app/Models/Post.php index feccb7a..0db6762 100644 --- a/app/Models/Post.php +++ b/app/Models/Post.php @@ -68,7 +68,7 @@ public static function boot() parent::boot(); static::updating(function ($post) { if ($post->isDirty('image') && !is_null($post->getRawOriginal('image'))) { - Storage::delete($post->getRawOriginal('image')); + Storage::delete($post->getRawOriginal('image')); } }); static::deleting(function ($post) { diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index 7393a9b..9e5ac01 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -15,7 +15,12 @@ class DatabaseSeeder extends Seeder public function run() { \App\Models\Setting::factory(1)->create(); - \App\Models\User::factory(20)->create(); + \App\Models\User::factory()->create([ + 'name' => 'Admin', + 'email' => 'admin@example.com', + 'role_id' => 1, + ]); + \App\Models\User::factory(19)->create(); \App\Models\Category::factory(5)->create(); \App\Models\Post::factory(50)->create(); \App\Models\Page::factory(10)->create();