From ff2deace3e03bd9a965f5cd612a9617b8d332b40 Mon Sep 17 00:00:00 2001 From: aslan Date: Fri, 19 Jan 2024 19:15:45 +0300 Subject: [PATCH] add resource Documents Online --- .../Controllers/DocumentsOnlineController.php | 65 ------------------- .../Controllers/OnlineDocumentsController.php | 65 +++++++++++++++++++ ...st.php => StoreOnlineDocumentsRequest.php} | 2 +- ...t.php => UpdateOnlineDocumentsRequest.php} | 2 +- ...ocumentsOnline.php => OnlineDocuments.php} | 7 +- ...nePolicy.php => OnlineDocumentsPolicy.php} | 14 ++-- database/factories/DocumentsOnlineFactory.php | 2 +- database/seeders/DatabaseSeeder.php | 6 +- ...neSeeder.php => OnlineDocumentsSeeder.php} | 4 +- .../views/documents-online/index.blade.php | 8 --- .../views/online-documents/index.blade.php | 11 ++++ routes/web.php | 4 +- 12 files changed, 97 insertions(+), 93 deletions(-) delete mode 100644 app/Http/Controllers/DocumentsOnlineController.php create mode 100644 app/Http/Controllers/OnlineDocumentsController.php rename app/Http/Requests/{StoreDocumentsOnlineRequest.php => StoreOnlineDocumentsRequest.php} (90%) rename app/Http/Requests/{UpdateDocumentsOnlineRequest.php => UpdateOnlineDocumentsRequest.php} (90%) rename app/Models/{DocumentsOnline.php => OnlineDocuments.php} (71%) rename app/Policies/{DocumentsOnlinePolicy.php => OnlineDocumentsPolicy.php} (71%) rename database/seeders/{DocumentsOnlineSeeder.php => OnlineDocumentsSeeder.php} (92%) delete mode 100644 resources/views/documents-online/index.blade.php create mode 100644 resources/views/online-documents/index.blade.php diff --git a/app/Http/Controllers/DocumentsOnlineController.php b/app/Http/Controllers/DocumentsOnlineController.php deleted file mode 100644 index b91f346..0000000 --- a/app/Http/Controllers/DocumentsOnlineController.php +++ /dev/null @@ -1,65 +0,0 @@ - + * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\OnlineDocuments> */ class DocumentsOnlineFactory extends Factory { diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index 4b2af79..f7a49d3 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -20,8 +20,8 @@ class DatabaseSeeder extends Seeder 'email' => 'test@example.com', 'password' => 123456 ]); -// $this->call([ -// DocumentsOnlineSeeder::class -// ]); + $this->call([ + OnlineDocumentsSeeder::class + ]); } } diff --git a/database/seeders/DocumentsOnlineSeeder.php b/database/seeders/OnlineDocumentsSeeder.php similarity index 92% rename from database/seeders/DocumentsOnlineSeeder.php rename to database/seeders/OnlineDocumentsSeeder.php index 70c055b..0f5009e 100644 --- a/database/seeders/DocumentsOnlineSeeder.php +++ b/database/seeders/OnlineDocumentsSeeder.php @@ -7,14 +7,14 @@ use Illuminate\Database\Console\Seeds\WithoutModelEvents; use Illuminate\Database\Seeder; use Illuminate\Support\Facades\DB; -class DocumentsOnlineSeeder extends Seeder +class OnlineDocumentsSeeder extends Seeder { /** * Run the database seeds. */ public function run(): void { - DB::table('documents_online')->insert([ + DB::table('online_documents')->insert([ [ 'name' => 'Подать документы онлайн', 'url' => '', diff --git a/resources/views/documents-online/index.blade.php b/resources/views/documents-online/index.blade.php deleted file mode 100644 index b4b4101..0000000 --- a/resources/views/documents-online/index.blade.php +++ /dev/null @@ -1,8 +0,0 @@ -@extends('layouts.admin-layout') -@section('content') - @foreach($documentsOnline as $documentOnline) - {{ $documentOnline->name }} - {{ $documentOnline->url }} - {{ $documentOnline->description }} - @endforeach -@endsection diff --git a/resources/views/online-documents/index.blade.php b/resources/views/online-documents/index.blade.php new file mode 100644 index 0000000..523adda --- /dev/null +++ b/resources/views/online-documents/index.blade.php @@ -0,0 +1,11 @@ +@extends('layouts.admin-layout') +@section('content') + @foreach($onlineDocuments as $onlineDocument) +
+ {{ $onlineDocument->name }} + {{ $onlineDocument->url }} + {{ $onlineDocument->parent }} + {{ $onlineDocument->children }} +
+ @endforeach +@endsection diff --git a/routes/web.php b/routes/web.php index fc2e08f..7ed14af 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,6 +1,6 @@ UserController::class, - '/documents-online' => DocumentsOnlineController::class + '/online-documents' => OnlineDocumentsController::class ]); Route::get('/course', function () {