From e8e132051a9c2ad20f5e197015a30b653a3bb57c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80=20?= =?UTF-8?q?=D0=91=D0=B0=D0=B1=D0=BA=D0=B8=D0=BD?= Date: Mon, 27 Jun 2022 20:39:35 +0300 Subject: [PATCH] project continue --- app/Http/Controllers/ProjectController.php | 14 +- .../2014_10_12_000000_create_users_table.php | 2 +- ...022_06_27_125710_create_projects_table.php | 3 +- ...119_create_doc_structure_models_table.php} | 1 + database/seeders/UsersTableSeeder.php | 8 + public/css/app.css | 171 ++++++++---------- resources/views/projects/create.blade.php | 62 +++---- 7 files changed, 128 insertions(+), 133 deletions(-) rename database/migrations/{2022_06_23_152119_create_doc_structure_models_table.php => 2022_06_27_152119_create_doc_structure_models_table.php} (93%) diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.php index ec70807..70308c6 100644 --- a/app/Http/Controllers/ProjectController.php +++ b/app/Http/Controllers/ProjectController.php @@ -36,7 +36,19 @@ class ProjectController extends Controller */ public function store(Request $request) { - // + $request->validate([ + 'name' => ['required', 'string', 'max:255', 'unique:users'], + 'description' => ['required', 'string', 'max:255'], + 'mmc_path' => ['required', 'string', 'max:255'], + ]); + + $user = Project::create([ + 'name' => $request->name, + 'description' => $request->description, + 'mmc_path' => $request->mmc_path, + ]); + + return redirect(route('projects.index')); } /** diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index 9d98360..cd2f296 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -15,7 +15,7 @@ class CreateUsersTable extends Migration { Schema::create('users', function (Blueprint $table) { $table->id(); - $table->string('username'); + $table->string('username')->unique(); $table->string('name'); $table->string('email')->unique(); $table->timestamp('email_verified_at')->nullable(); diff --git a/database/migrations/2022_06_27_125710_create_projects_table.php b/database/migrations/2022_06_27_125710_create_projects_table.php index 18c664f..d2e24c7 100644 --- a/database/migrations/2022_06_27_125710_create_projects_table.php +++ b/database/migrations/2022_06_27_125710_create_projects_table.php @@ -15,8 +15,9 @@ class CreateProjectsTable extends Migration { Schema::create('projects', function (Blueprint $table) { $table->id(); - $table->string('name'); + $table->string('name')->unique(); $table->string('description'); + $table->string('mmc_path'); $table->timestamps(); $table->softDeletes(); }); diff --git a/database/migrations/2022_06_23_152119_create_doc_structure_models_table.php b/database/migrations/2022_06_27_152119_create_doc_structure_models_table.php similarity index 93% rename from database/migrations/2022_06_23_152119_create_doc_structure_models_table.php rename to database/migrations/2022_06_27_152119_create_doc_structure_models_table.php index a747a62..0b90849 100644 --- a/database/migrations/2022_06_23_152119_create_doc_structure_models_table.php +++ b/database/migrations/2022_06_27_152119_create_doc_structure_models_table.php @@ -15,6 +15,7 @@ class CreateDocStructureModelsTable extends Migration { Schema::create('doc_structure_models', function (Blueprint $table) { $table->id(); + $table->integer('project_id')->unsigned(); $table->string('category'); $table->integer('parent_id')->unsigned()->nullable(); $table->timestamps(); diff --git a/database/seeders/UsersTableSeeder.php b/database/seeders/UsersTableSeeder.php index 928f919..208155d 100644 --- a/database/seeders/UsersTableSeeder.php +++ b/database/seeders/UsersTableSeeder.php @@ -17,5 +17,13 @@ class UsersTableSeeder extends Seeder 'password' => Hash::make('12345678'), 'is_admin' => true, ]); + + DB::table('users')->insert([ + 'username' => 'bolotina', + 'name' => 'Юлия Болотина', + 'email' => 'bolotina@dinamika-avia.ru', + 'password' => Hash::make('12345678'), + 'is_admin' => false, + ]); } } diff --git a/public/css/app.css b/public/css/app.css index b2976f2..223b8ce 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -710,15 +710,6 @@ select { .-ml-px { margin-left: -1px; } -.mt-1 { - margin-top: 0.25rem; -} -.mt-4 { - margin-top: 1rem; -} -.ml-4 { - margin-left: 1rem; -} .ml-1 { margin-left: 0.25rem; } @@ -731,6 +722,12 @@ select { .ml-2 { margin-left: 0.5rem; } +.mt-4 { + margin-top: 1rem; +} +.ml-4 { + margin-left: 1rem; +} .mt-8 { margin-top: 2rem; } @@ -740,17 +737,20 @@ select { .-mt-px { margin-top: -1px; } -.-mr-2 { - margin-right: -0.5rem; +.mb-4 { + margin-bottom: 1rem; +} +.mt-1 { + margin-top: 0.25rem; +} +.mt-6 { + margin-top: 1.5rem; } .mt-3 { margin-top: 0.75rem; } -.mb-4 { - margin-bottom: 1rem; -} -.mt-6 { - margin-top: 1.5rem; +.-mr-2 { + margin-right: -0.5rem; } .block { display: block; @@ -779,6 +779,9 @@ select { .h-16 { height: 4rem; } +.h-20 { + height: 5rem; +} .h-10 { height: 2.5rem; } @@ -788,45 +791,39 @@ select { .h-6 { height: 1.5rem; } -.h-20 { - height: 5rem; -} .min-h-screen { min-height: 100vh; } .w-5 { width: 1.25rem; } -.w-full { - width: 100%; -} .w-8 { width: 2rem; } .w-auto { width: auto; } +.w-20 { + width: 5rem; +} +.w-full { + width: 100%; +} +.w-48 { + width: 12rem; +} .w-4 { width: 1rem; } .w-6 { width: 1.5rem; } -.w-48 { - width: 12rem; -} -.w-20 { - width: 5rem; -} .max-w-7xl { max-width: 80rem; } .max-w-6xl { max-width: 72rem; } -.max-w-xl { - max-width: 36rem; -} .flex-1 { flex: 1 1 0%; } @@ -927,9 +924,6 @@ select { .border-l-4 { border-left-width: 4px; } -.border-r { - border-right-width: 1px; -} .border-gray-300 { --tw-border-opacity: 1; border-color: rgb(209 213 219 / var(--tw-border-opacity)); @@ -938,10 +932,6 @@ select { --tw-border-opacity: 1; border-color: rgb(229 231 235 / var(--tw-border-opacity)); } -.border-gray-100 { - --tw-border-opacity: 1; - border-color: rgb(243 244 246 / var(--tw-border-opacity)); -} .border-transparent { border-color: transparent; } @@ -949,9 +939,9 @@ select { --tw-border-opacity: 1; border-color: rgb(129 140 248 / var(--tw-border-opacity)); } -.border-gray-400 { +.border-gray-100 { --tw-border-opacity: 1; - border-color: rgb(156 163 175 / var(--tw-border-opacity)); + border-color: rgb(243 244 246 / var(--tw-border-opacity)); } .bg-white { --tw-bg-opacity: 1; @@ -990,10 +980,6 @@ select { padding-left: 0.5rem; padding-right: 0.5rem; } -.py-6 { - padding-top: 1.5rem; - padding-bottom: 1.5rem; -} .py-12 { padding-top: 3rem; padding-bottom: 3rem; @@ -1014,21 +1000,13 @@ select { padding-left: 0.25rem; padding-right: 0.25rem; } +.py-6 { + padding-top: 1.5rem; + padding-bottom: 1.5rem; +} .pt-8 { padding-top: 2rem; } -.pt-2 { - padding-top: 0.5rem; -} -.pb-3 { - padding-bottom: 0.75rem; -} -.pt-4 { - padding-top: 1rem; -} -.pb-1 { - padding-bottom: 0.25rem; -} .pt-6 { padding-top: 1.5rem; } @@ -1041,6 +1019,18 @@ select { .pr-4 { padding-right: 1rem; } +.pt-2 { + padding-top: 0.5rem; +} +.pb-3 { + padding-bottom: 0.75rem; +} +.pt-4 { + padding-top: 1rem; +} +.pb-1 { + padding-bottom: 0.25rem; +} .text-center { text-align: center; } @@ -1059,14 +1049,14 @@ select { font-size: 1.125rem; line-height: 1.75rem; } -.text-base { - font-size: 1rem; - line-height: 1.5rem; -} .text-xs { font-size: 0.75rem; line-height: 1rem; } +.text-base { + font-size: 1rem; + line-height: 1.5rem; +} .font-medium { font-weight: 500; } @@ -1088,9 +1078,6 @@ select { .tracking-widest { letter-spacing: 0.1em; } -.tracking-wider { - letter-spacing: 0.05em; -} .text-gray-500 { --tw-text-opacity: 1; color: rgb(107 114 128 / var(--tw-text-opacity)); @@ -1123,26 +1110,26 @@ select { --tw-text-opacity: 1; color: rgb(17 24 39 / var(--tw-text-opacity)); } +.text-indigo-600 { + --tw-text-opacity: 1; + color: rgb(79 70 229 / var(--tw-text-opacity)); +} .text-green-600 { --tw-text-opacity: 1; color: rgb(22 163 74 / var(--tw-text-opacity)); } -.text-white { - --tw-text-opacity: 1; - color: rgb(255 255 255 / var(--tw-text-opacity)); -} .text-red-600 { --tw-text-opacity: 1; color: rgb(220 38 38 / var(--tw-text-opacity)); } +.text-white { + --tw-text-opacity: 1; + color: rgb(255 255 255 / var(--tw-text-opacity)); +} .text-indigo-700 { --tw-text-opacity: 1; color: rgb(67 56 202 / var(--tw-text-opacity)); } -.text-indigo-600 { - --tw-text-opacity: 1; - color: rgb(79 70 229 / var(--tw-text-opacity)); -} .underline { -webkit-text-decoration-line: underline; text-decoration-line: underline; @@ -1167,16 +1154,16 @@ select { --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color); box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); } -.shadow-lg { - --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); - --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color); - box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); -} .shadow-md { --tw-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); --tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color); box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); } +.shadow-lg { + --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); + --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color); + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); +} .ring-1 { --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color); @@ -1222,14 +1209,14 @@ select { --tw-border-opacity: 1; border-color: rgb(209 213 219 / var(--tw-border-opacity)); } -.hover\:bg-gray-100:hover { - --tw-bg-opacity: 1; - background-color: rgb(243 244 246 / var(--tw-bg-opacity)); -} .hover\:bg-gray-700:hover { --tw-bg-opacity: 1; background-color: rgb(55 65 81 / var(--tw-bg-opacity)); } +.hover\:bg-gray-100:hover { + --tw-bg-opacity: 1; + background-color: rgb(243 244 246 / var(--tw-bg-opacity)); +} .hover\:bg-gray-50:hover { --tw-bg-opacity: 1; background-color: rgb(249 250 251 / var(--tw-bg-opacity)); @@ -1242,14 +1229,14 @@ select { --tw-text-opacity: 1; color: rgb(156 163 175 / var(--tw-text-opacity)); } -.hover\:text-gray-700:hover { - --tw-text-opacity: 1; - color: rgb(55 65 81 / var(--tw-text-opacity)); -} .hover\:text-gray-900:hover { --tw-text-opacity: 1; color: rgb(17 24 39 / var(--tw-text-opacity)); } +.hover\:text-gray-700:hover { + --tw-text-opacity: 1; + color: rgb(55 65 81 / var(--tw-text-opacity)); +} .hover\:text-gray-800:hover { --tw-text-opacity: 1; color: rgb(31 41 55 / var(--tw-text-opacity)); @@ -1261,10 +1248,6 @@ select { --tw-border-opacity: 1; border-color: rgb(147 197 253 / var(--tw-border-opacity)); } -.focus\:border-gray-300:focus { - --tw-border-opacity: 1; - border-color: rgb(209 213 219 / var(--tw-border-opacity)); -} .focus\:border-indigo-300:focus { --tw-border-opacity: 1; border-color: rgb(165 180 252 / var(--tw-border-opacity)); @@ -1277,6 +1260,10 @@ select { --tw-border-opacity: 1; border-color: rgb(67 56 202 / var(--tw-border-opacity)); } +.focus\:border-gray-300:focus { + --tw-border-opacity: 1; + border-color: rgb(209 213 219 / var(--tw-border-opacity)); +} .focus\:bg-gray-100:focus { --tw-bg-opacity: 1; background-color: rgb(243 244 246 / var(--tw-bg-opacity)); @@ -1293,10 +1280,6 @@ select { --tw-text-opacity: 1; color: rgb(55 65 81 / var(--tw-text-opacity)); } -.focus\:text-gray-500:focus { - --tw-text-opacity: 1; - color: rgb(107 114 128 / var(--tw-text-opacity)); -} .focus\:text-indigo-800:focus { --tw-text-opacity: 1; color: rgb(55 48 163 / var(--tw-text-opacity)); @@ -1305,6 +1288,10 @@ select { --tw-text-opacity: 1; color: rgb(31 41 55 / var(--tw-text-opacity)); } +.focus\:text-gray-500:focus { + --tw-text-opacity: 1; + color: rgb(107 114 128 / var(--tw-text-opacity)); +} .focus\:outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; diff --git a/resources/views/projects/create.blade.php b/resources/views/projects/create.blade.php index c3f1234..294969e 100644 --- a/resources/views/projects/create.blade.php +++ b/resources/views/projects/create.blade.php @@ -1,7 +1,7 @@

- {{ __('Create user') }} + {{ __('Create project') }}

@@ -9,50 +9,36 @@
- +
- @csrf - -
- + @csrf + +
+ - -
+ +
- -
- + +
+ - -
+ +
- -
- + +
+ - -
+ +
- -
- - - -
- - -
- - - -
- -
- - {{ __('Register') }} - -
-
+
+ + {{ __('Create project') }} + +
+