project continue

This commit is contained in:
Александр Бабкин
2022-06-27 20:39:35 +03:00
parent 34f6fa7733
commit e8e132051a
7 changed files with 128 additions and 133 deletions

View File

@@ -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'));
}
/**

View File

@@ -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();

View File

@@ -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();
});

View File

@@ -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();

View File

@@ -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,
]);
}
}

View File

@@ -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;

View File

@@ -1,7 +1,7 @@
<x-app-layout>
<x-slot name="header">
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
{{ __('Create user') }}
{{ __('Create project') }}
</h2>
</x-slot>
@@ -9,47 +9,33 @@
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
<div class="p-6 bg-white border-b border-gray-200">
<x-validation-error class="mb-4" :errors="$errors" />
<form method="POST" action="{{ route('users.store') }}">
@csrf
<!-- User name -->
<!-- Project name -->
<div>
<x-label for="username" :value="__('User name')" />
<x-label for="name" :value="__('Title')" />
<x-input id="username" class="block mt-1 w-full" type="text" name="username" :value="old('username')" required autofocus />
<x-input id="name" class="block mt-1 w-full" type="text" name="name" :value="old('name')" required autofocus />
</div>
<!-- Name -->
<div>
<x-label for="name" :value="__('Name')" />
<x-input id="name" class="block mt-1 w-full" type="text" name="name" :value="old('name')" required />
</div>
<!-- Email Address -->
<!-- Description -->
<div class="mt-4">
<x-label for="email" :value="__('Email')" />
<x-label for="description" :value="__('Description')" />
<x-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" required />
<x-input id="description" class="block mt-1 w-full" type="text" name="description" :value="old('description')" required />
</div>
<!-- Password -->
<!-- MMC Path -->
<div class="mt-4">
<x-label for="password" :value="__('Password')" />
<x-label for="mmc_path" :value="__('MMC Path')" />
<x-input id="password" class="block mt-1 w-full" type="password" name="password" required autocomplete="new-password" />
</div>
<!-- Confirm Password -->
<div class="mt-4">
<x-label for="password_confirmation" :value="__('Confirm Password')" />
<x-input id="password_confirmation" class="block mt-1 w-full" type="password" name="password_confirmation" required />
<x-input id="mmc_path" class="block mt-1 w-full" type="text" name="mmc_path" :value="old('mmc_path')" required />
</div>
<div class="flex items-center justify-end mt-4">
<x-button class="ml-4">
{{ __('Register') }}
{{ __('Create project') }}
</x-button>
</div>
</form>