-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
84af866
commit 5838e41
Showing
21 changed files
with
231 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace Database\Seeders; | ||
|
||
use Illuminate\Support\Facades\DB; | ||
use Illuminate\Database\Seeder; | ||
use App\Models\Task; | ||
use App\Models\Label; | ||
|
||
class TaskLabelSeeder extends Seeder | ||
{ | ||
/** | ||
* Run the database seeds. | ||
*/ | ||
public function run(): void | ||
{ | ||
for ($i = 0; $i < 5; $i++) { | ||
Task::all()->random()->labels()->saveMany([ | ||
Label::all()->random(), | ||
Label::all()->random() | ||
]); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Database\Seeders; | ||
|
||
use App\Models\Task; | ||
use Illuminate\Database\Seeder; | ||
|
||
class TaskSeeder extends Seeder | ||
{ | ||
/** | ||
* Run the database seeds. | ||
*/ | ||
public function run(): void | ||
{ | ||
Task::factory() | ||
->assignetToSequence() | ||
->count(5) | ||
->create(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Database\Seeders; | ||
|
||
use Illuminate\Database\Console\Seeds\WithoutModelEvents; | ||
use Illuminate\Database\Seeder; | ||
use App\Models\User; | ||
|
||
class UserSeeder extends Seeder | ||
{ | ||
/** | ||
* Run the database seeds. | ||
*/ | ||
public function run(): void | ||
{ | ||
User::factory() | ||
->count(5) | ||
->create(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<div class="text-xs inline-flex items-center font-bold leading-sm uppercase px-3 py-1 bg-blue-200 text-blue-700 rounded-full"> | ||
|
||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="h-4 w-4"> | ||
<path stroke-linecap="round" stroke-linejoin="round" d="m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13" /> | ||
</svg> | ||
|
||
{{ $slot }} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<x-app-layout> | ||
<x-slot name="header"> | ||
<h1 class="mb-5 text-5xl">{{ __('Create label') }}</h1> | ||
</x-slot> | ||
|
||
{{ html()->form('POST', route('labels.store'))->class('flex flex-col w-50')->open() }} | ||
@include('labels.form') | ||
<div class="mt-2"> | ||
<x-primary-button> | ||
{{ __('Create') }} | ||
</x-primary-button> | ||
</div> | ||
{{ html()->form()->close() }} | ||
</x-app-layout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<x-app-layout> | ||
<x-slot name="header"> | ||
<h1 class="mb-5 text-5xl">{{ __('Change label')}}</h1> | ||
</x-slot> | ||
|
||
{{ html()->modelForm($label, "PATCH", route('labels.update', $label))->class('flex flex-col')->open() }} | ||
@include('labels.form') | ||
<div class="mt-2"> | ||
<x-primary-button> | ||
{{ __('Edit') }} | ||
</x-primary-button> | ||
</div> | ||
{{ html()->closeModelForm() }} | ||
</x-app-layout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<div class="mt-2"> | ||
{{ html()->label(__('Name'), 'name')->class('block font-medium text-sm text-gray-700 dark:text-gray-300') }} | ||
</div> | ||
<div class="mt-2"> | ||
{{ html()->input('text', 'name')->class('w-1/3 rounded border-gray-300')}} | ||
</div> | ||
<div class="mt-2"> | ||
{{ html()->label(__('Description'), 'description')->class('block font-medium text-sm text-gray-700 dark:text-gray-300') }} | ||
</div> | ||
<div class="mt-2"> | ||
{{ html()->textarea('description')->class('w-1/3 rounded border-gray-300')}} | ||
</div> | ||
<x-input-error :messages="$errors->get('name')" class="mt-2" /> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<x-app-layout> | ||
<x-slot name="header"> | ||
<h1 class="mb-5 text-5xl">{{ __('Labels')}}</h1> | ||
</x-slot> | ||
|
||
<a href="{{ route('labels.create') }}"> | ||
<x-primary-button > | ||
{{ __('Create label') }} | ||
</x-primary-button> | ||
</a> | ||
|
||
<table class="mt-4"> | ||
<thead class="border-b-2 border-solid border-black text-left"> | ||
<tr> | ||
<th>ID</th> | ||
<th>{{ __('Name') }}</th> | ||
<th>{{ __('Created at') }}</th> | ||
<th>{{ __('Actions') }}</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
@foreach ($labels as $label) | ||
<tr class="border-b border-dashed text-left"> | ||
<td>{{ $label->id }}</td> | ||
<td>{{ $label->name }}</td> | ||
<td>{{ $label->created_at }}</td> | ||
<td> | ||
@auth | ||
<a data-confirm="Вы уверены?" data-method="delete" class="text-red-600 hover:text-red-900" href="{{ route('labels.destroy', $label) }}"> | ||
{{ __('Delete') }} | ||
</a> | ||
<a class="text-blue-600 hover:text-blue-900" href="{{ route('labels.edit', $label) }}"> | ||
{{ __('Change') }} | ||
</a> | ||
@endauth | ||
</td> | ||
</tr> | ||
@endforeach | ||
</tbody> | ||
</table> | ||
|
||
<div class="mt-3"> | ||
{{ $labels->links('pagination::tailwind') }} | ||
</div> | ||
</x-app-layout> |
Oops, something went wrong.