From 5758671a61c28a47fb71f477ebe12d0cf29b10ab Mon Sep 17 00:00:00 2001 From: bret Date: Mon, 11 Nov 2024 05:28:29 +0000 Subject: [PATCH 1/6] fix contract period intersection --- app/Http/Controllers/DemandController.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/DemandController.php b/app/Http/Controllers/DemandController.php index 2a432645..649d7d72 100644 --- a/app/Http/Controllers/DemandController.php +++ b/app/Http/Controllers/DemandController.php @@ -41,8 +41,13 @@ public function index(Request $request): View // Collect resources with contracts in the next 12 months $resources = Resource::whereIn( 'id', - Contract::whereBetween('start_date', [$startDate, $endDate]) - ->orWhereBetween('end_date', [$startDate, $endDate]) + Contract::where(function ($q) use ($startDate, $endDate) { + $q->where('start_date', '<=', $endDate) + ->where(function ($q) use ($startDate) { + $q->where('end_date', '>=', $startDate) + ->orWhereNull('end_date'); + }); + }) ->pluck('resources_id') ->unique() ->values() From c3d2ed41e03896bb0644edc98a548aaa3bdb9e73 Mon Sep 17 00:00:00 2001 From: bret Date: Mon, 11 Nov 2024 06:11:48 +0000 Subject: [PATCH 2/6] add tables and some crud --- app/Http/Controllers/ResourceController.php | 18 ++-- .../Controllers/ResourceSkillController.php | 56 ++++++++++++ app/Http/Controllers/SkillController.php | 87 +++++++++++++++++++ app/Http/Requests/ResourceSkillRequest.php | 30 +++++++ app/Http/Requests/SkillLibraryRequest.php | 29 +++++++ app/Http/Requests/SkillRequest.php | 30 +++++++ app/Http/Resources/ResourceSkillResource.php | 19 ++++ app/Models/ResourceSkill.php | 51 +++++++++++ app/Models/Skill.php | 43 +++++++++ app/Providers/AppServiceProvider.php | 1 + composer.lock | 12 +-- config/laravel-migration-generator.php | 54 ++++++++++++ ...1_11_054107_create_skill_library_table.php | 31 +++++++ ..._11_054122_create_resource_skill_table.php | 31 +++++++ ...d_foreign_keys_to_resource_skill_table.php | 30 +++++++ resources/views/skill/create.blade.php | 28 ++++++ resources/views/skill/edit.blade.php | 29 +++++++ resources/views/skill/form.blade.php | 29 +++++++ resources/views/skill/index.blade.php | 77 ++++++++++++++++ resources/views/skill/show.blade.php | 45 ++++++++++ routes/web.php | 2 + 21 files changed, 716 insertions(+), 16 deletions(-) create mode 100644 app/Http/Controllers/ResourceSkillController.php create mode 100644 app/Http/Controllers/SkillController.php create mode 100644 app/Http/Requests/ResourceSkillRequest.php create mode 100644 app/Http/Requests/SkillLibraryRequest.php create mode 100644 app/Http/Requests/SkillRequest.php create mode 100644 app/Http/Resources/ResourceSkillResource.php create mode 100644 app/Models/ResourceSkill.php create mode 100644 app/Models/Skill.php create mode 100644 config/laravel-migration-generator.php create mode 100644 database/migrations/2024_11_11_054107_create_skill_library_table.php create mode 100644 database/migrations/2024_11_11_054122_create_resource_skill_table.php create mode 100644 database/migrations/2024_11_11_054125_add_foreign_keys_to_resource_skill_table.php create mode 100644 resources/views/skill/create.blade.php create mode 100644 resources/views/skill/edit.blade.php create mode 100644 resources/views/skill/form.blade.php create mode 100644 resources/views/skill/index.blade.php create mode 100644 resources/views/skill/show.blade.php diff --git a/app/Http/Controllers/ResourceController.php b/app/Http/Controllers/ResourceController.php index 2134d099..cc7bed7f 100644 --- a/app/Http/Controllers/ResourceController.php +++ b/app/Http/Controllers/ResourceController.php @@ -9,6 +9,8 @@ use App\Models\Project; use App\Models\Leave; use App\Models\Resource; +use App\Models\ResourceSkill; +use App\Models\Skill; use Carbon\Carbon; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; @@ -154,7 +156,11 @@ public function show($id): View { $resource = Resource::find($id); - return view('resource.show', compact('resource')); + // Get the skills for the resource + $skills = ResourceSkill::where('resources_id', $id)->pluck('skills_id'); + $skills = Skill::whereIn('id', $skills)->get(); + + return view('resource.show', compact('resource', 'skills')); } /** @@ -213,15 +219,7 @@ public function allocations($id): View return view('resource.allocations', compact('resource', 'allocationArray','projects', 'nextTwelveMonths')); } - /** - * Show the form for editing the specified resource. - */ - public function edit($id): View - { - $resource = Resource::find($id); - - return view('resource.edit', compact('resource')); - } + /** * Update the specified resource in storage. diff --git a/app/Http/Controllers/ResourceSkillController.php b/app/Http/Controllers/ResourceSkillController.php new file mode 100644 index 00000000..31fa199d --- /dev/null +++ b/app/Http/Controllers/ResourceSkillController.php @@ -0,0 +1,56 @@ +validated()); + } + + /** + * Display the specified resource. + */ + public function show(ResourceSkill $resourceSkill): ResourceSkill + { + return $resourceSkill; + } + + /** + * Update the specified resource in storage. + */ + public function update(ResourceSkillRequest $request, ResourceSkill $resourceSkill): ResourceSkill + { + $resourceSkill->update($request->validated()); + + return $resourceSkill; + } + + public function destroy(ResourceSkill $resourceSkill): Response + { + $resourceSkill->delete(); + + return response()->noContent(); + } +} diff --git a/app/Http/Controllers/SkillController.php b/app/Http/Controllers/SkillController.php new file mode 100644 index 00000000..0c4568f1 --- /dev/null +++ b/app/Http/Controllers/SkillController.php @@ -0,0 +1,87 @@ +with('i', ($request->input('page', 1) - 1) * $skills->perPage()); + } + + /** + * Show the form for creating a new resource. + */ + public function create(): View + { + $skill = new Skill(); + + return view('skill.create', compact('skill')); + } + + /** + * Store a newly created resource in storage. + */ + public function store(SkillRequest $request): RedirectResponse + { + $validated = $request->validated(); + $validated['sfia_level'] = (int) $validated['sfia_level']; + + Skill::create($validated); + + return Redirect::route('skills.index') + ->with('success', 'Skill created successfully.'); + } + + /** + * Display the specified resource. + */ + public function show($id): View + { + $skill = Skill::find($id); + + return view('skill.show', compact('skill')); + } + + /** + * Show the form for editing the specified resource. + */ + public function edit($id): View + { + $skill = Skill::find($id); + + return view('skill.edit', compact('skill')); + } + + /** + * Update the specified resource in storage. + */ + public function update(SkillRequest $request, Skill $skill): RedirectResponse + { + $skill->update($request->validated()); + + return Redirect::route('skills.index') + ->with('success', 'Skill updated successfully'); + } + + public function destroy($id): RedirectResponse + { + Skill::find($id)->delete(); + + return Redirect::route('skills.index') + ->with('success', 'Skill deleted successfully'); + } +} diff --git a/app/Http/Requests/ResourceSkillRequest.php b/app/Http/Requests/ResourceSkillRequest.php new file mode 100644 index 00000000..9649c26e --- /dev/null +++ b/app/Http/Requests/ResourceSkillRequest.php @@ -0,0 +1,30 @@ +|string> + */ + public function rules(): array + { + return [ + 'resource_id' => 'required', + 'skill_id' => 'required', + 'proficiency_levels' => 'required', + ]; + } +} diff --git a/app/Http/Requests/SkillLibraryRequest.php b/app/Http/Requests/SkillLibraryRequest.php new file mode 100644 index 00000000..0cd35972 --- /dev/null +++ b/app/Http/Requests/SkillLibraryRequest.php @@ -0,0 +1,29 @@ +|string> + */ + public function rules(): array + { + return [ + 'skill_name' => 'required|string', + 'skill_description' => 'string', + ]; + } +} diff --git a/app/Http/Requests/SkillRequest.php b/app/Http/Requests/SkillRequest.php new file mode 100644 index 00000000..1e064547 --- /dev/null +++ b/app/Http/Requests/SkillRequest.php @@ -0,0 +1,30 @@ +|string> + */ + public function rules(): array + { + return [ + 'skill_name' => 'required|string', + 'skill_description' => 'string', + 'sfia_code' => 'string', + ]; + } +} diff --git a/app/Http/Resources/ResourceSkillResource.php b/app/Http/Resources/ResourceSkillResource.php new file mode 100644 index 00000000..33f07007 --- /dev/null +++ b/app/Http/Resources/ResourceSkillResource.php @@ -0,0 +1,19 @@ + + */ + public function toArray(Request $request): array + { + return parent::toArray($request); + } +} diff --git a/app/Models/ResourceSkill.php b/app/Models/ResourceSkill.php new file mode 100644 index 00000000..53fe66fd --- /dev/null +++ b/app/Models/ResourceSkill.php @@ -0,0 +1,51 @@ + + */ + protected $fillable = ['resource_id', 'skill_id', 'proficiency_levels']; + + + /** + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ + public function resource() + { + return $this->belongsTo(\App\Models\Resource::class, 'resource_id', 'id'); + } + + /** + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ + public function skill() + { + return $this->belongsTo(\App\Models\Skill::class, 'skill_id', 'id'); + } + +} diff --git a/app/Models/Skill.php b/app/Models/Skill.php new file mode 100644 index 00000000..6b383b05 --- /dev/null +++ b/app/Models/Skill.php @@ -0,0 +1,43 @@ + + */ + protected $fillable = ['skill_name', 'skill_description', 'sfia_code', 'sfia_level']; + + + /** + * @return \Illuminate\Database\Eloquent\Relations\HasMany + */ + public function resourceSkills() + { + return $this->hasMany(\App\Models\ResourceSkill::class, 'id', 'skill_id'); + } + +} diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index f71a3816..8d399593 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -28,6 +28,7 @@ public function boot(): void ->add(Link::to(route('resources.index'), $this->wrapInSpan('Resources'))->addClass('sidebar-link')->addParentClass('sidebar-item')) ->add(Link::to(route('contracts.index'), $this->wrapInSpan('Contracts'))->addClass('sidebar-link')->addParentClass('sidebar-item')) ->add(Link::to(route('leaves.index'), $this->wrapInSpan('Leaves'))->addClass('sidebar-link')->addParentClass('sidebar-item')) + ->add(Link::to(route('skills.index'), $this->wrapInSpan('Skills'))->addClass('sidebar-link')->addParentClass('sidebar-item')) ->add(Link::to(route('projects.index'), $this->wrapInSpan('Projects'))->addClass('sidebar-link')->addParentClass('sidebar-item')) ->add(Link::to(route('allocations.index'), $this->wrapInSpan('Allocations'))->addClass('sidebar-link')->addParentClass('sidebar-item')) ->add(Link::to(route('demands.index'), $this->wrapInSpan('Demands'))->addClass('sidebar-link')->addParentClass('sidebar-item')) diff --git a/composer.lock b/composer.lock index 4e68dbcb..0a99e70b 100644 --- a/composer.lock +++ b/composer.lock @@ -6712,16 +6712,16 @@ }, { "name": "kitloong/laravel-migrations-generator", - "version": "v7.0.5", + "version": "v7.0.6", "source": { "type": "git", "url": "https://github.com/kitloong/laravel-migrations-generator.git", - "reference": "8b3575285bc3d65a084085fb20d7c1ba5f903c4e" + "reference": "3d036e3030928f904c833a8e004fd4914f301236" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/kitloong/laravel-migrations-generator/zipball/8b3575285bc3d65a084085fb20d7c1ba5f903c4e", - "reference": "8b3575285bc3d65a084085fb20d7c1ba5f903c4e", + "url": "https://api.github.com/repos/kitloong/laravel-migrations-generator/zipball/3d036e3030928f904c833a8e004fd4914f301236", + "reference": "3d036e3030928f904c833a8e004fd4914f301236", "shasum": "" }, "require": { @@ -6773,7 +6773,7 @@ ], "support": { "issues": "https://github.com/kitloong/laravel-migrations-generator/issues", - "source": "https://github.com/kitloong/laravel-migrations-generator/tree/v7.0.5" + "source": "https://github.com/kitloong/laravel-migrations-generator/tree/v7.0.6" }, "funding": [ { @@ -6785,7 +6785,7 @@ "type": "github" } ], - "time": "2024-08-06T13:18:32+00:00" + "time": "2024-11-03T12:05:10+00:00" }, { "name": "laravel/pint", diff --git a/config/laravel-migration-generator.php b/config/laravel-migration-generator.php new file mode 100644 index 00000000..981cba5c --- /dev/null +++ b/config/laravel-migration-generator.php @@ -0,0 +1,54 @@ + env('LMG_RUN_AFTER_MIGRATIONS', false), + 'clear_output_path' => env('LMG_CLEAR_OUTPUT_PATH', false), + //default configs + 'table_naming_scheme' => env('LMG_TABLE_NAMING_SCHEME', '[IndexedTimestamp]_create_[TableName]_table.php'), + 'view_naming_scheme' => env('LMG_VIEW_NAMING_SCHEME', '[IndexedTimestamp]_create_[ViewName]_view.php'), + 'path' => env('LMG_OUTPUT_PATH', 'tests/database/migrations'), + 'skippable_tables' => env('LMG_SKIPPABLE_TABLES', 'migrations'), + 'skip_views' => env('LMG_SKIP_VIEWS', false), + 'skippable_views' => env('LMG_SKIPPABLE_VIEWS', ''), + 'sort_mode' => env('LMG_SORT_MODE', 'foreign_key'), + 'definitions' => [ + 'prefer_unsigned_prefix' => env('LMG_PREFER_UNSIGNED_PREFIX', true), + 'use_defined_index_names' => env('LMG_USE_DEFINED_INDEX_NAMES', true), + 'use_defined_foreign_key_index_names' => env('LMG_USE_DEFINED_FOREIGN_KEY_INDEX_NAMES', true), + 'use_defined_unique_key_index_names' => env('LMG_USE_DEFINED_UNIQUE_KEY_INDEX_NAMES', true), + 'use_defined_primary_key_index_names' => env('LMG_USE_DEFINED_PRIMARY_KEY_INDEX_NAMES', true), + 'with_comments' => env('LMG_WITH_COMMENTS', true), + 'use_defined_datatype_on_timestamp' => env('LMG_USE_DEFINED_DATATYPE_ON_TIMESTAMP', false), + ], + + //now driver specific configs + //null = use default + 'mysql' => [ + 'table_naming_scheme' => env('LMG_MYSQL_TABLE_NAMING_SCHEME', null), + 'view_naming_scheme' => env('LMG_MYSQL_VIEW_NAMING_SCHEME', null), + 'path' => env('LMG_MYSQL_OUTPUT_PATH', null), + 'skippable_tables' => env('LMG_MYSQL_SKIPPABLE_TABLES', null), + 'skippable_views' => env('LMG_MYSQL_SKIPPABLE_VIEWS', null), + ], + 'sqlite' => [ + 'table_naming_scheme' => env('LMG_SQLITE_TABLE_NAMING_SCHEME', null), + 'view_naming_scheme' => env('LMG_SQLITE_VIEW_NAMING_SCHEME', null), + 'path' => env('LMG_SQLITE_OUTPUT_PATH', null), + 'skippable_tables' => env('LMG_SQLITE_SKIPPABLE_TABLES', null), + 'skippable_views' => env('LMG_SQLITE_SKIPPABLE_VIEWS', null), + ], + 'pgsql' => [ + 'table_naming_scheme' => env('LMG_PGSQL_TABLE_NAMING_SCHEME', null), + 'view_naming_scheme' => env('LMG_PGSQL_VIEW_NAMING_SCHEME', null), + 'path' => env('LMG_PGSQL_OUTPUT_PATH', null), + 'skippable_tables' => env('LMG_PGSQL_SKIPPABLE_TABLES', null), + 'skippable_views' => env('LMG_PGSQL_SKIPPABLE_VIEWS', null), + ], + 'sqlsrv' => [ + 'table_naming_scheme' => env('LMG_SQLSRV_TABLE_NAMING_SCHEME', null), + 'view_naming_scheme' => env('LMG_SQLSRV_VIEW_NAMING_SCHEME', null), + 'path' => env('LMG_SQLSRV_OUTPUT_PATH', null), + 'skippable_tables' => env('LMG_SQLSRV_SKIPPABLE_TABLES', null), + 'skippable_views' => env('LMG_SQLSRV_SKIPPABLE_VIEWS', null), + ], +]; diff --git a/database/migrations/2024_11_11_054107_create_skill_library_table.php b/database/migrations/2024_11_11_054107_create_skill_library_table.php new file mode 100644 index 00000000..4e1506bf --- /dev/null +++ b/database/migrations/2024_11_11_054107_create_skill_library_table.php @@ -0,0 +1,31 @@ +integer('id', true); + $table->string('skill_name')->unique(); + $table->text('skill_description')->nullable(); + $table->string('sfia_code')->nullable(); + $table->integer('sfia_level')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('skills'); + } +}; diff --git a/database/migrations/2024_11_11_054122_create_resource_skill_table.php b/database/migrations/2024_11_11_054122_create_resource_skill_table.php new file mode 100644 index 00000000..2d24752d --- /dev/null +++ b/database/migrations/2024_11_11_054122_create_resource_skill_table.php @@ -0,0 +1,31 @@ +integer('resources_id'); + $table->integer('skills_id')->index('resource_skill_skill_id_foreign'); + $table->enum('proficiency_levels', ['Beginner', 'Intermediate', 'Advanced', 'Expert'])->default('Beginner'); + $table->timestamps(); + + $table->primary(['resources_id', 'skills_id']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('resource_skill'); + } +}; diff --git a/database/migrations/2024_11_11_054125_add_foreign_keys_to_resource_skill_table.php b/database/migrations/2024_11_11_054125_add_foreign_keys_to_resource_skill_table.php new file mode 100644 index 00000000..16080984 --- /dev/null +++ b/database/migrations/2024_11_11_054125_add_foreign_keys_to_resource_skill_table.php @@ -0,0 +1,30 @@ +foreign(['resources_id'])->references(['id'])->on('resources')->onUpdate('no action')->onDelete('cascade'); + $table->foreign(['skills_id'])->references(['id'])->on('skills')->onUpdate('no action')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('resource_skill', function (Blueprint $table) { + $table->dropForeign('resource_skill_resource_id_foreign'); + $table->dropForeign('resource_skill_skill_id_foreign'); + }); + } +}; diff --git a/resources/views/skill/create.blade.php b/resources/views/skill/create.blade.php new file mode 100644 index 00000000..011e6f0b --- /dev/null +++ b/resources/views/skill/create.blade.php @@ -0,0 +1,28 @@ +@extends('layouts.app') + +@section('template_title') + {{ __('Create') }} Skill +@endsection + +@section('content') +
+
+
+ +
+
+ {{ __('Create') }} Skill +
+
+
+ @csrf + + @include('skill.form') + +
+
+
+
+
+
+@endsection diff --git a/resources/views/skill/edit.blade.php b/resources/views/skill/edit.blade.php new file mode 100644 index 00000000..7a1145b3 --- /dev/null +++ b/resources/views/skill/edit.blade.php @@ -0,0 +1,29 @@ +@extends('layouts.app') + +@section('template_title') + {{ __('Update') }} Skill +@endsection + +@section('content') +
+
+
+ +
+
+ {{ __('Update') }} Skill +
+
+
+ {{ method_field('PATCH') }} + @csrf + + @include('skill.form') + +
+
+
+
+
+
+@endsection diff --git a/resources/views/skill/form.blade.php b/resources/views/skill/form.blade.php new file mode 100644 index 00000000..11a40f14 --- /dev/null +++ b/resources/views/skill/form.blade.php @@ -0,0 +1,29 @@ +
+
+ +
+ + + {!! $errors->first('skill_name', '') !!} +
+
+ + + {!! $errors->first('skill_description', '') !!} +
+
+ + + {!! $errors->first('sfia_code', '') !!} +
+
+ + + {!! $errors->first('sfia_level', '') !!} +
+ +
+
+ +
+
\ No newline at end of file diff --git a/resources/views/skill/index.blade.php b/resources/views/skill/index.blade.php new file mode 100644 index 00000000..70e5f484 --- /dev/null +++ b/resources/views/skill/index.blade.php @@ -0,0 +1,77 @@ +@extends('layouts.app') + +@section('template_title') + Skills +@endsection + +@section('content') +
+
+
+
+
+
+ + + {{ __('Skills') }} + + + +
+
+ @if ($message = Session::get('success')) +
+

{{ $message }}

+
+ @endif + +
+
+ + + + + + + + + + + + + + + @foreach ($skills as $skill) + + + + + + + + + + + @endforeach + +
NoSkill NameSkill DescriptionSfia CodeSfia Level
{{ ++$i }}{{ $skill->skill_name }}{{ $skill->skill_description }}{{ $skill->sfia_code }}{{ $skill->sfia_level }} +
+ {{ __('Show') }} + {{ __('Edit') }} + @csrf + @method('DELETE') + +
+
+
+
+
+ {!! $skills->withQueryString()->links() !!} +
+
+
+@endsection diff --git a/resources/views/skill/show.blade.php b/resources/views/skill/show.blade.php new file mode 100644 index 00000000..2c63b2a3 --- /dev/null +++ b/resources/views/skill/show.blade.php @@ -0,0 +1,45 @@ +@extends('layouts.app') + +@section('template_title') + {{ $skill->name ?? __('Show') . " " . __('Skill') }} +@endsection + +@section('content') +
+
+
+
+
+
+ {{ __('Show') }} Skill +
+ +
+ +
+ +
+ Skill Name: + {{ $skill->skill_name }} +
+
+ Skill Description: + {{ $skill->skill_description }} +
+
+ Sfia Code: + {{ $skill->sfia_code }} +
+
+ Sfia Level: + {{ $skill->sfia_level }} +
+ +
+
+
+
+
+@endsection diff --git a/routes/web.php b/routes/web.php index 9b9f3b5c..a83198cf 100644 --- a/routes/web.php +++ b/routes/web.php @@ -8,6 +8,7 @@ use App\Http\Controllers\DemandController; use App\Http\Controllers\LeaveController; use App\Http\Controllers\ProjectController; +use App\Http\Controllers\SkillController; /* |-------------------------------------------------------------------------- @@ -38,3 +39,4 @@ Route::resource('resources', ResourceController::class); Route::get('/resources/{resource}/allocations', [ResourceController::class, 'allocations'])->name('resources.allocations'); +Route::resource('skills', SkillController::class); From fd26f54fd423081eb827882fa210597d9dcac4a9 Mon Sep 17 00:00:00 2001 From: bret Date: Tue, 12 Nov 2024 05:49:39 +0000 Subject: [PATCH 3/6] tweaked laravel-dashboard to allow inclusion in the content frame --- composer.json | 17 +- composer.lock | 421 +++++++++++++++++---------------- resources/views/home.blade.php | 47 ++-- 3 files changed, 257 insertions(+), 228 deletions(-) diff --git a/composer.json b/composer.json index e541f384..76a17722 100644 --- a/composer.json +++ b/composer.json @@ -2,8 +2,17 @@ "name": "laravel/laravel", "type": "project", "description": "The skeleton application for the Laravel framework.", - "keywords": ["laravel", "framework"], + "keywords": [ + "laravel", + "framework" + ], "license": "MIT", + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/baradhili/laravel-dashboard.git" + } + ], "require": { "php": "^8.1", "avadim/fast-excel-laravel": "^2.7", @@ -12,7 +21,6 @@ "laravel/sanctum": "^3.3", "laravel/tinker": "^2.8", "livewire/livewire": "^3.5", - "spatie/laravel-dashboard": "^3.1", "spatie/laravel-menu": "^4.2" }, "require-dev": { @@ -28,7 +36,8 @@ "nunomaduro/collision": "^7.0", "orangehill/iseed": "^3.0", "phpunit/phpunit": "^10.1", - "spatie/laravel-ignition": "^2.0" + "spatie/laravel-ignition": "^2.0", + "spatie/laravel-dashboard": "dev-main" }, "autoload": { "psr-4": { @@ -73,4 +82,4 @@ }, "minimum-stability": "stable", "prefer-stable": true -} +} \ No newline at end of file diff --git a/composer.lock b/composer.lock index 0a99e70b..4ad21739 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b57f852f8f5ff765975bb9d7f050b3db", + "content-hash": "c500351b45f9424e539c55f0c237cb38", "packages": [ { "name": "avadim/fast-excel-helper", - "version": "v1.2.1", + "version": "v1.2.2", "source": { "type": "git", "url": "https://github.com/aVadim483/fast-excel-helper.git", - "reference": "2792c4a20b529b537ede7148e2c29dc4677818db" + "reference": "aed67aa6e4cb516f86ebf7c3c9ef209209e70c53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aVadim483/fast-excel-helper/zipball/2792c4a20b529b537ede7148e2c29dc4677818db", - "reference": "2792c4a20b529b537ede7148e2c29dc4677818db", + "url": "https://api.github.com/repos/aVadim483/fast-excel-helper/zipball/aed67aa6e4cb516f86ebf7c3c9ef209209e70c53", + "reference": "aed67aa6e4cb516f86ebf7c3c9ef209209e70c53", "shasum": "" }, "require": { @@ -57,9 +57,9 @@ ], "support": { "issues": "https://github.com/aVadim483/fast-excel-helper/issues", - "source": "https://github.com/aVadim483/fast-excel-helper/tree/v1.2.1" + "source": "https://github.com/aVadim483/fast-excel-helper/tree/v1.2.2" }, - "time": "2024-09-06T20:37:07+00:00" + "time": "2024-10-31T17:42:37+00:00" }, { "name": "avadim/fast-excel-laravel", @@ -128,16 +128,16 @@ }, { "name": "avadim/fast-excel-reader", - "version": "v2.21.0", + "version": "v2.21.1", "source": { "type": "git", "url": "https://github.com/aVadim483/fast-excel-reader.git", - "reference": "203eaa37bd92fe6ba682ed703b2a437a33c149a0" + "reference": "53b2725954cabfa898b67e76ea36e873e870ad19" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aVadim483/fast-excel-reader/zipball/203eaa37bd92fe6ba682ed703b2a437a33c149a0", - "reference": "203eaa37bd92fe6ba682ed703b2a437a33c149a0", + "url": "https://api.github.com/repos/aVadim483/fast-excel-reader/zipball/53b2725954cabfa898b67e76ea36e873e870ad19", + "reference": "53b2725954cabfa898b67e76ea36e873e870ad19", "shasum": "" }, "require": { @@ -179,9 +179,9 @@ ], "support": { "issues": "https://github.com/aVadim483/fast-excel-reader/issues", - "source": "https://github.com/aVadim483/fast-excel-reader/tree/v2.21.0" + "source": "https://github.com/aVadim483/fast-excel-reader/tree/v2.21.1" }, - "time": "2024-10-27T21:10:12+00:00" + "time": "2024-11-01T16:08:22+00:00" }, { "name": "avadim/fast-excel-writer", @@ -3494,82 +3494,6 @@ ], "time": "2024-04-27T21:32:50+00:00" }, - { - "name": "spatie/laravel-dashboard", - "version": "3.1.0", - "source": { - "type": "git", - "url": "https://github.com/spatie/laravel-dashboard.git", - "reference": "218d83d8130231e78dd5591cb3abdd7c1e9e1a5d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-dashboard/zipball/218d83d8130231e78dd5591cb3abdd7c1e9e1a5d", - "reference": "218d83d8130231e78dd5591cb3abdd7c1e9e1a5d", - "shasum": "" - }, - "require": { - "illuminate/database": "^8.0|^9.0|^10.0|^11.0", - "illuminate/view": "^8.0|^9.0|^10.0|^11.0", - "livewire/livewire": "^3.0", - "php": "^7.4|^8.0", - "spatie/sun": "^1.1.1" - }, - "require-dev": { - "orchestra/testbench": "^6.0|^7.0|^8.0|^9.0", - "phpunit/phpunit": "^9.3|^10.5", - "spatie/phpunit-snapshot-assertions": "^4.2|^5.1" - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "Spatie\\Dashboard\\DashboardServiceProvider" - ], - "aliases": { - "Dashboard": "Spatie\\Dashboard\\Facades\\Dashboard" - } - } - }, - "autoload": { - "psr-4": { - "Spatie\\Dashboard\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "homepage": "https://spatie.be", - "role": "Developer" - } - ], - "description": "A dashboard for Laravel", - "homepage": "https://github.com/spatie/laravel-dashboard", - "keywords": [ - "laravel-dashboard", - "spatie" - ], - "support": { - "issues": "https://github.com/spatie/laravel-dashboard/issues", - "source": "https://github.com/spatie/laravel-dashboard/tree/3.1.0" - }, - "funding": [ - { - "url": "https://spatie.be/open-source/support-us", - "type": "custom" - }, - { - "url": "https://github.com/spatie", - "type": "github" - } - ], - "time": "2024-03-02T05:54:28+00:00" - }, { "name": "spatie/laravel-menu", "version": "4.2.0", @@ -3758,70 +3682,6 @@ ], "time": "2023-04-12T10:02:12+00:00" }, - { - "name": "spatie/sun", - "version": "1.1.2", - "source": { - "type": "git", - "url": "https://github.com/spatie/sun.git", - "reference": "12d195e38adab756c067f04f3a0b07a5d18f018a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spatie/sun/zipball/12d195e38adab756c067f04f3a0b07a5d18f018a", - "reference": "12d195e38adab756c067f04f3a0b07a5d18f018a", - "shasum": "" - }, - "require": { - "nesbot/carbon": "^2.32", - "php": "^8.0|^7.4" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.16", - "pestphp/pest": "^1.0", - "spatie/test-time": "^1.2", - "symfony/var-dumper": "^4.3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Spatie\\Sun\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "homepage": "https://spatie.be", - "role": "Developer" - } - ], - "description": "Get information on the position of the sun", - "homepage": "https://github.com/spatie/sun", - "keywords": [ - "spatie", - "sun" - ], - "support": { - "issues": "https://github.com/spatie/sun/issues", - "source": "https://github.com/spatie/sun/tree/1.1.2" - }, - "funding": [ - { - "url": "https://spatie.be/open-source/support-us", - "type": "custom" - }, - { - "url": "https://github.com/spatie", - "type": "github" - } - ], - "time": "2021-07-22T08:48:57+00:00" - }, { "name": "spatie/url", "version": "2.4.0", @@ -3886,16 +3746,16 @@ }, { "name": "symfony/console", - "version": "v6.4.13", + "version": "v6.4.14", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "f793dd5a7d9ae9923e35d0503d08ba734cec1d79" + "reference": "897c2441ed4eec8a8a2c37b943427d24dba3f26b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/f793dd5a7d9ae9923e35d0503d08ba734cec1d79", - "reference": "f793dd5a7d9ae9923e35d0503d08ba734cec1d79", + "url": "https://api.github.com/repos/symfony/console/zipball/897c2441ed4eec8a8a2c37b943427d24dba3f26b", + "reference": "897c2441ed4eec8a8a2c37b943427d24dba3f26b", "shasum": "" }, "require": { @@ -3960,7 +3820,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.4.13" + "source": "https://github.com/symfony/console/tree/v6.4.14" }, "funding": [ { @@ -3976,7 +3836,7 @@ "type": "tidelift" } ], - "time": "2024-10-09T08:40:40+00:00" + "time": "2024-11-05T15:34:40+00:00" }, { "name": "symfony/css-selector", @@ -4112,16 +3972,16 @@ }, { "name": "symfony/error-handler", - "version": "v6.4.13", + "version": "v6.4.14", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "e3c78742f86a5b65fe2ac4c4b6b776d92fd7ca0c" + "reference": "9e024324511eeb00983ee76b9aedc3e6ecd993d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/e3c78742f86a5b65fe2ac4c4b6b776d92fd7ca0c", - "reference": "e3c78742f86a5b65fe2ac4c4b6b776d92fd7ca0c", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/9e024324511eeb00983ee76b9aedc3e6ecd993d9", + "reference": "9e024324511eeb00983ee76b9aedc3e6ecd993d9", "shasum": "" }, "require": { @@ -4167,7 +4027,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v6.4.13" + "source": "https://github.com/symfony/error-handler/tree/v6.4.14" }, "funding": [ { @@ -4183,7 +4043,7 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:18:03+00:00" + "time": "2024-11-05T15:34:40+00:00" }, { "name": "symfony/event-dispatcher", @@ -4407,16 +4267,16 @@ }, { "name": "symfony/http-foundation", - "version": "v6.4.13", + "version": "v6.4.14", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "4c0341b3e0a7291e752c69d2a1ed9a84b68d604c" + "reference": "ba020a321a95519303a3f09ec2824d34d601c388" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/4c0341b3e0a7291e752c69d2a1ed9a84b68d604c", - "reference": "4c0341b3e0a7291e752c69d2a1ed9a84b68d604c", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/ba020a321a95519303a3f09ec2824d34d601c388", + "reference": "ba020a321a95519303a3f09ec2824d34d601c388", "shasum": "" }, "require": { @@ -4464,7 +4324,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v6.4.13" + "source": "https://github.com/symfony/http-foundation/tree/v6.4.14" }, "funding": [ { @@ -4480,20 +4340,20 @@ "type": "tidelift" } ], - "time": "2024-10-11T19:20:58+00:00" + "time": "2024-11-05T16:39:55+00:00" }, { "name": "symfony/http-kernel", - "version": "v6.4.13", + "version": "v6.4.14", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "4474015c363ec0cd3bf47d55657e68630dbae66e" + "reference": "8278a947d0369754a47b758a9e17b72cab970951" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/4474015c363ec0cd3bf47d55657e68630dbae66e", - "reference": "4474015c363ec0cd3bf47d55657e68630dbae66e", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/8278a947d0369754a47b758a9e17b72cab970951", + "reference": "8278a947d0369754a47b758a9e17b72cab970951", "shasum": "" }, "require": { @@ -4578,7 +4438,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v6.4.13" + "source": "https://github.com/symfony/http-kernel/tree/v6.4.14" }, "funding": [ { @@ -4594,7 +4454,7 @@ "type": "tidelift" } ], - "time": "2024-10-27T13:00:29+00:00" + "time": "2024-11-06T09:45:21+00:00" }, { "name": "symfony/mailer", @@ -5399,16 +5259,16 @@ }, { "name": "symfony/process", - "version": "v6.4.13", + "version": "v6.4.14", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "1f9f59b46880201629df3bd950fc5ae8c55b960f" + "reference": "25214adbb0996d18112548de20c281be9f27279f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/1f9f59b46880201629df3bd950fc5ae8c55b960f", - "reference": "1f9f59b46880201629df3bd950fc5ae8c55b960f", + "url": "https://api.github.com/repos/symfony/process/zipball/25214adbb0996d18112548de20c281be9f27279f", + "reference": "25214adbb0996d18112548de20c281be9f27279f", "shasum": "" }, "require": { @@ -5440,7 +5300,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.4.13" + "source": "https://github.com/symfony/process/tree/v6.4.14" }, "funding": [ { @@ -5456,7 +5316,7 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:18:03+00:00" + "time": "2024-11-06T09:25:01+00:00" }, { "name": "symfony/routing", @@ -5960,16 +5820,16 @@ }, { "name": "symfony/var-dumper", - "version": "v6.4.13", + "version": "v6.4.14", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "2acb151474ed8cb43624e3f41a0bf7c4c8ce4f41" + "reference": "93c09246038178717a9c14b809ea8151ffcf7091" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/2acb151474ed8cb43624e3f41a0bf7c4c8ce4f41", - "reference": "2acb151474ed8cb43624e3f41a0bf7c4c8ce4f41", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/93c09246038178717a9c14b809ea8151ffcf7091", + "reference": "93c09246038178717a9c14b809ea8151ffcf7091", "shasum": "" }, "require": { @@ -6025,7 +5885,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v6.4.13" + "source": "https://github.com/symfony/var-dumper/tree/v6.4.14" }, "funding": [ { @@ -6041,7 +5901,7 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:18:03+00:00" + "time": "2024-11-05T15:34:40+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -6400,16 +6260,16 @@ }, { "name": "fakerphp/faker", - "version": "v1.23.1", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/FakerPHP/Faker.git", - "reference": "bfb4fe148adbf78eff521199619b93a52ae3554b" + "reference": "a136842a532bac9ecd8a1c723852b09915d7db50" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/bfb4fe148adbf78eff521199619b93a52ae3554b", - "reference": "bfb4fe148adbf78eff521199619b93a52ae3554b", + "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/a136842a532bac9ecd8a1c723852b09915d7db50", + "reference": "a136842a532bac9ecd8a1c723852b09915d7db50", "shasum": "" }, "require": { @@ -6457,9 +6317,9 @@ ], "support": { "issues": "https://github.com/FakerPHP/Faker/issues", - "source": "https://github.com/FakerPHP/Faker/tree/v1.23.1" + "source": "https://github.com/FakerPHP/Faker/tree/v1.24.0" }, - "time": "2024-01-02T13:46:09+00:00" + "time": "2024-11-07T15:11:20+00:00" }, { "name": "filp/whoops", @@ -7132,16 +6992,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.12.0", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", "shasum": "" }, "require": { @@ -7180,7 +7040,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" }, "funding": [ { @@ -7188,7 +7048,7 @@ "type": "tidelift" } ], - "time": "2024-06-12T14:39:25+00:00" + "time": "2024-11-08T17:47:46+00:00" }, { "name": "nunomaduro/collision", @@ -9094,6 +8954,97 @@ ], "time": "2024-06-12T14:55:22+00:00" }, + { + "name": "spatie/laravel-dashboard", + "version": "dev-main", + "source": { + "type": "git", + "url": "https://github.com/baradhili/laravel-dashboard.git", + "reference": "800091af9885bc6585a90f432b8578b7cadeec50" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/baradhili/laravel-dashboard/zipball/800091af9885bc6585a90f432b8578b7cadeec50", + "reference": "800091af9885bc6585a90f432b8578b7cadeec50", + "shasum": "" + }, + "require": { + "illuminate/database": "^8.0|^9.0|^10.0|^11.0", + "illuminate/view": "^8.0|^9.0|^10.0|^11.0", + "livewire/livewire": "^3.0", + "php": "^7.4|^8.0", + "spatie/sun": "^1.1.1" + }, + "require-dev": { + "orchestra/testbench": "^6.0|^7.0|^8.0|^9.0", + "phpunit/phpunit": "^9.3|^10.5", + "spatie/phpunit-snapshot-assertions": "^4.2|^5.1" + }, + "default-branch": true, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Spatie\\Dashboard\\DashboardServiceProvider" + ], + "aliases": { + "Dashboard": "Spatie\\Dashboard\\Facades\\Dashboard" + } + } + }, + "autoload": { + "psr-4": { + "Spatie\\Dashboard\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "Spatie\\Dashboard\\Tests\\": "tests" + } + }, + "scripts": { + "test": [ + "vendor/bin/phpunit" + ], + "test-coverage": [ + "vendor/bin/phpunit --coverage-html coverage" + ], + "format": [ + "vendor/bin/php-cs-fixer fix --allow-risky=yes" + ] + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "A dashboard for Laravel", + "homepage": "https://github.com/spatie/laravel-dashboard", + "keywords": [ + "laravel-dashboard", + "spatie" + ], + "support": { + "source": "https://github.com/baradhili/laravel-dashboard/tree/main" + }, + "funding": [ + { + "type": "github", + "url": "https://github.com/spatie" + }, + { + "type": "custom", + "url": "https://spatie.be/open-source/support-us" + } + ], + "time": "2024-11-12T05:44:10+00:00" + }, { "name": "spatie/laravel-ignition", "version": "2.8.0", @@ -9185,6 +9136,70 @@ ], "time": "2024-06-12T15:01:18+00:00" }, + { + "name": "spatie/sun", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/spatie/sun.git", + "reference": "12d195e38adab756c067f04f3a0b07a5d18f018a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/sun/zipball/12d195e38adab756c067f04f3a0b07a5d18f018a", + "reference": "12d195e38adab756c067f04f3a0b07a5d18f018a", + "shasum": "" + }, + "require": { + "nesbot/carbon": "^2.32", + "php": "^8.0|^7.4" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.16", + "pestphp/pest": "^1.0", + "spatie/test-time": "^1.2", + "symfony/var-dumper": "^4.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\Sun\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "Get information on the position of the sun", + "homepage": "https://github.com/spatie/sun", + "keywords": [ + "spatie", + "sun" + ], + "support": { + "issues": "https://github.com/spatie/sun/issues", + "source": "https://github.com/spatie/sun/tree/1.1.2" + }, + "funding": [ + { + "url": "https://spatie.be/open-source/support-us", + "type": "custom" + }, + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2021-07-22T08:48:57+00:00" + }, { "name": "symfony/yaml", "version": "v7.1.6", @@ -9309,7 +9324,9 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "spatie/laravel-dashboard": 20 + }, "prefer-stable": true, "prefer-lowest": false, "platform": { diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index b04df987..5f990832 100644 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -5,32 +5,35 @@ @endsection @section('content') -
-
-
-
+
+
+
+
-
- @if (session('status')) - - @endif +
+ @if (session('status')) + + @endif - {{ __('You are logged in!') }} + {{ __('You are logged in!') }} +
+ widgets: +
    +
  • Average Workload
  • +
  • Contractor Tenure Tracker
  • +
  • Skill Set Coverage and Gaps
  • +
  • Unrecovered Resource Cost
  • +
  • Upcoming Demands
  • +
  • Demand Funnel
  • +
  • Resource Availability by Month
  • +
+ + +
- widgets: -
    -
  • Average Workload
  • -
  • Contractor Tenure Tracker
  • -
  • Skill Set Coverage and Gaps
  • -
  • Unrecovered Resource Cost
  • -
  • Upcoming Demands
  • -
  • Demand Funnel
  • -
  • Resource Availability by Month
  • -
-
@endsection From 0c3f8d2c22483f9bda2114cbbb733a95b72a4acf Mon Sep 17 00:00:00 2001 From: bret Date: Tue, 12 Nov 2024 06:42:53 +0000 Subject: [PATCH 4/6] add in controls to show spatie dashboard --- composer.lock | 8 ++++---- config/dashboard.php | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/composer.lock b/composer.lock index 4ad21739..d8086032 100644 --- a/composer.lock +++ b/composer.lock @@ -8960,12 +8960,12 @@ "source": { "type": "git", "url": "https://github.com/baradhili/laravel-dashboard.git", - "reference": "800091af9885bc6585a90f432b8578b7cadeec50" + "reference": "310a75c84ce9154f9f8faa23c6f7bff0aa23c13c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/baradhili/laravel-dashboard/zipball/800091af9885bc6585a90f432b8578b7cadeec50", - "reference": "800091af9885bc6585a90f432b8578b7cadeec50", + "url": "https://api.github.com/repos/baradhili/laravel-dashboard/zipball/310a75c84ce9154f9f8faa23c6f7bff0aa23c13c", + "reference": "310a75c84ce9154f9f8faa23c6f7bff0aa23c13c", "shasum": "" }, "require": { @@ -9043,7 +9043,7 @@ "url": "https://spatie.be/open-source/support-us" } ], - "time": "2024-11-12T05:44:10+00:00" + "time": "2024-11-12T06:35:55+00:00" }, { "name": "spatie/laravel-ignition", diff --git a/config/dashboard.php b/config/dashboard.php index 6c17cc9c..816b4651 100644 --- a/config/dashboard.php +++ b/config/dashboard.php @@ -26,4 +26,9 @@ 'stylesheets' => [ 'inter' => 'https://rsms.me/inter/inter.css', ], + + /** + * A flag to tell if the dashboard is a single page or not. + */ + 'single_page' => false, ]; From 0a16dbd049a3abf9a0e66579f166a364e5075fee Mon Sep 17 00:00:00 2001 From: bret Date: Tue, 12 Nov 2024 07:26:09 +0000 Subject: [PATCH 5/6] moving forward on create/add a skill --- .../Controllers/ResourceSkillController.php | 88 ++++++++++++++++--- app/Http/Requests/ResourceSkillRequest.php | 4 +- app/Models/ResourceSkill.php | 10 +-- composer.json | 3 +- composer.lock | 65 +------------- .../views/resource-skill/create.blade.php | 28 ++++++ resources/views/resource-skill/edit.blade.php | 29 ++++++ resources/views/resource-skill/form.blade.php | 44 ++++++++++ .../views/resource-skill/index.blade.php | 75 ++++++++++++++++ resources/views/resource-skill/show.blade.php | 41 +++++++++ resources/views/resource/show.blade.php | 25 ++++++ routes/web.php | 5 +- 12 files changed, 329 insertions(+), 88 deletions(-) create mode 100644 resources/views/resource-skill/create.blade.php create mode 100644 resources/views/resource-skill/edit.blade.php create mode 100644 resources/views/resource-skill/form.blade.php create mode 100644 resources/views/resource-skill/index.blade.php create mode 100644 resources/views/resource-skill/show.blade.php diff --git a/app/Http/Controllers/ResourceSkillController.php b/app/Http/Controllers/ResourceSkillController.php index 31fa199d..f3136df4 100644 --- a/app/Http/Controllers/ResourceSkillController.php +++ b/app/Http/Controllers/ResourceSkillController.php @@ -3,54 +3,114 @@ namespace App\Http\Controllers; use App\Models\ResourceSkill; +use App\Models\Skill; +use App\Models\Resource; +use App\Models\Contract; +use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; use App\Http\Requests\ResourceSkillRequest; -use Illuminate\Http\Response; -use App\Http\Controllers\Controller; -use App\Http\Resources\ResourceSkillResource; +use Illuminate\Support\Facades\Redirect; +use Illuminate\View\View; +use Illuminate\Support\Facades\Log; +use Carbon\Carbon; class ResourceSkillController extends Controller { /** * Display a listing of the resource. */ - public function index(Request $request) + public function index(Request $request): View { $resourceSkills = ResourceSkill::paginate(); - return ResourceSkillResource::collection($resourceSkills); + return view('resource-skill.index', compact('resourceSkills')) + ->with('i', ($request->input('page', 1) - 1) * $resourceSkills->perPage()); + } + + /** + * Show the form for creating a new resource. + */ + public function create(Request $request): View + { + Log::info("in create"); + $resourceId = $request->query('resource_id'); + $resource = null; + if ($resourceId) { + $resource = Resource::findOrFail($resourceId); + Log::info("resource id = " . $resource->full_name); + + $skills = ResourceSkill::where('resources_id', $resource->id)->get(); + + $allSkills = Skill::all(); + $unassignedSkills = $allSkills->diff($skills->toArray()); + + $resources = null; + + } else { + $resource = new Resource(); + $resource->id = 0; + + $currentContracts = Contract::where('end_date', '>=', Carbon::today())->pluck('resources_id'); + $resources = Resource::whereIn('id', $currentContracts)->get(); + + $allSkills = Skill::all(); + $unassignedSkills = $allSkills; + } + + + + $resourceSkill = new ResourceSkill(); + + return view('resource-skill.create', compact('resourceSkill', 'resource', 'unassignedSkills','resources')); } /** * Store a newly created resource in storage. */ - public function store(ResourceSkillRequest $request): ResourceSkill + public function store(ResourceSkillRequest $request): RedirectResponse { - return ResourceSkill::create($request->validated()); + ResourceSkill::create($request->validated()); + + return Redirect::route('resource-skills.index') + ->with('success', 'ResourceSkill created successfully.'); } /** * Display the specified resource. */ - public function show(ResourceSkill $resourceSkill): ResourceSkill + public function show($id): View { - return $resourceSkill; + $resourceSkill = ResourceSkill::find($id); + + return view('resource-skill.show', compact('resourceSkill')); + } + + /** + * Show the form for editing the specified resource. + */ + public function edit($id): View + { + $resourceSkill = ResourceSkill::find($id); + + return view('resource-skill.edit', compact('resourceSkill')); } /** * Update the specified resource in storage. */ - public function update(ResourceSkillRequest $request, ResourceSkill $resourceSkill): ResourceSkill + public function update(ResourceSkillRequest $request, ResourceSkill $resourceSkill): RedirectResponse { $resourceSkill->update($request->validated()); - return $resourceSkill; + return Redirect::route('resource-skills.index') + ->with('success', 'ResourceSkill updated successfully'); } - public function destroy(ResourceSkill $resourceSkill): Response + public function destroy($id): RedirectResponse { - $resourceSkill->delete(); + ResourceSkill::find($id)->delete(); - return response()->noContent(); + return Redirect::route('resource-skills.index') + ->with('success', 'ResourceSkill deleted successfully'); } } diff --git a/app/Http/Requests/ResourceSkillRequest.php b/app/Http/Requests/ResourceSkillRequest.php index 9649c26e..ba10be47 100644 --- a/app/Http/Requests/ResourceSkillRequest.php +++ b/app/Http/Requests/ResourceSkillRequest.php @@ -22,8 +22,8 @@ public function authorize(): bool public function rules(): array { return [ - 'resource_id' => 'required', - 'skill_id' => 'required', + 'resources_id' => 'required', + 'skills_id' => 'required', 'proficiency_levels' => 'required', ]; } diff --git a/app/Models/ResourceSkill.php b/app/Models/ResourceSkill.php index 53fe66fd..4d9bddfa 100644 --- a/app/Models/ResourceSkill.php +++ b/app/Models/ResourceSkill.php @@ -7,8 +7,8 @@ /** * Class ResourceSkill * - * @property $resource_id - * @property $skill_id + * @property $resources_id + * @property $skills_id * @property $proficiency_levels * @property $created_at * @property $updated_at @@ -29,7 +29,7 @@ class ResourceSkill extends Model * * @var array */ - protected $fillable = ['resource_id', 'skill_id', 'proficiency_levels']; + protected $fillable = ['resources_id', 'skills_id', 'proficiency_levels']; /** @@ -37,7 +37,7 @@ class ResourceSkill extends Model */ public function resource() { - return $this->belongsTo(\App\Models\Resource::class, 'resource_id', 'id'); + return $this->belongsTo(\App\Models\Resource::class, 'resources_id', 'id'); } /** @@ -45,7 +45,7 @@ public function resource() */ public function skill() { - return $this->belongsTo(\App\Models\Skill::class, 'skill_id', 'id'); + return $this->belongsTo(\App\Models\Skill::class, 'skills_id', 'id'); } } diff --git a/composer.json b/composer.json index 76a17722..8d280400 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,6 @@ "kitloong/laravel-migrations-generator": "^7.0", "laravel/pint": "^1.0", "laravel/sail": "^1.18", - "laravel/ui": "^4.5", "mockery/mockery": "^1.4.4", "nunomaduro/collision": "^7.0", "orangehill/iseed": "^3.0", @@ -82,4 +81,4 @@ }, "minimum-stability": "stable", "prefer-stable": true -} \ No newline at end of file +} diff --git a/composer.lock b/composer.lock index d8086032..04f975e2 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c500351b45f9424e539c55f0c237cb38", + "content-hash": "f257ac737436b5098c15a84aae23c48f", "packages": [ { "name": "avadim/fast-excel-helper", @@ -6776,69 +6776,6 @@ }, "time": "2024-10-29T20:18:14+00:00" }, - { - "name": "laravel/ui", - "version": "v4.5.2", - "source": { - "type": "git", - "url": "https://github.com/laravel/ui.git", - "reference": "c75396f63268c95b053c8e4814eb70e0875e9628" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laravel/ui/zipball/c75396f63268c95b053c8e4814eb70e0875e9628", - "reference": "c75396f63268c95b053c8e4814eb70e0875e9628", - "shasum": "" - }, - "require": { - "illuminate/console": "^9.21|^10.0|^11.0", - "illuminate/filesystem": "^9.21|^10.0|^11.0", - "illuminate/support": "^9.21|^10.0|^11.0", - "illuminate/validation": "^9.21|^10.0|^11.0", - "php": "^8.0", - "symfony/console": "^6.0|^7.0" - }, - "require-dev": { - "orchestra/testbench": "^7.35|^8.15|^9.0", - "phpunit/phpunit": "^9.3|^10.4|^11.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.x-dev" - }, - "laravel": { - "providers": [ - "Laravel\\Ui\\UiServiceProvider" - ] - } - }, - "autoload": { - "psr-4": { - "Laravel\\Ui\\": "src/", - "Illuminate\\Foundation\\Auth\\": "auth-backend/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "Laravel UI utilities and presets.", - "keywords": [ - "laravel", - "ui" - ], - "support": { - "source": "https://github.com/laravel/ui/tree/v4.5.2" - }, - "time": "2024-05-08T18:07:10+00:00" - }, { "name": "maximebf/debugbar", "version": "v1.23.3", diff --git a/resources/views/resource-skill/create.blade.php b/resources/views/resource-skill/create.blade.php new file mode 100644 index 00000000..084aa5d4 --- /dev/null +++ b/resources/views/resource-skill/create.blade.php @@ -0,0 +1,28 @@ +@extends('layouts.app') + +@section('template_title') + {{ __('Create') }} Resource Skill +@endsection + +@section('content') +
+
+
+ +
+
+ {{ __('Create') }} Resource Skill +
+
+
+ @csrf + + @include('resource-skill.form') + +
+
+
+
+
+
+@endsection diff --git a/resources/views/resource-skill/edit.blade.php b/resources/views/resource-skill/edit.blade.php new file mode 100644 index 00000000..6ea37950 --- /dev/null +++ b/resources/views/resource-skill/edit.blade.php @@ -0,0 +1,29 @@ +@extends('layouts.app') + +@section('template_title') + {{ __('Update') }} Resource Skill +@endsection + +@section('content') +
+
+
+ +
+
+ {{ __('Update') }} Resource Skill +
+
+
+ {{ method_field('PATCH') }} + @csrf + + @include('resource-skill.form') + +
+
+
+
+
+
+@endsection diff --git a/resources/views/resource-skill/form.blade.php b/resources/views/resource-skill/form.blade.php new file mode 100644 index 00000000..f7ef5f2e --- /dev/null +++ b/resources/views/resource-skill/form.blade.php @@ -0,0 +1,44 @@ +
+
+ +
+ + @if($resource->id != 0) + + + @else + + @endif + {!! $errors->first('resources_id', '') !!} +
+
+ + + {!! $errors->first('skills_id', '') !!} +
+
+ + + {!! $errors->first('proficiency_levels', '') !!} +
+ +
+
+ +
+
\ No newline at end of file diff --git a/resources/views/resource-skill/index.blade.php b/resources/views/resource-skill/index.blade.php new file mode 100644 index 00000000..02461936 --- /dev/null +++ b/resources/views/resource-skill/index.blade.php @@ -0,0 +1,75 @@ +@extends('layouts.app') + +@section('template_title') + Resource Skills +@endsection + +@section('content') +
+
+
+
+
+
+ + + {{ __('Resource Skills') }} + + + +
+
+ @if ($message = Session::get('success')) +
+

{{ $message }}

+
+ @endif + +
+
+ + + + + + + + + + + + + + @foreach ($resourceSkills as $resourceSkill) + + + + + + + + + + @endforeach + +
NoResources IdSkills IdProficiency Levels
{{ ++$i }}{{ $resourceSkill->resources_id }}{{ $resourceSkill->skills_id }}{{ $resourceSkill->proficiency_levels }} +
+ {{ __('Show') }} + {{ __('Edit') }} + @csrf + @method('DELETE') + +
+
+
+
+
+ {!! $resourceSkills->withQueryString()->links() !!} +
+
+
+@endsection diff --git a/resources/views/resource-skill/show.blade.php b/resources/views/resource-skill/show.blade.php new file mode 100644 index 00000000..e0e84b26 --- /dev/null +++ b/resources/views/resource-skill/show.blade.php @@ -0,0 +1,41 @@ +@extends('layouts.app') + +@section('template_title') + {{ $resourceSkill->name ?? __('Show') . " " . __('Resource Skill') }} +@endsection + +@section('content') +
+
+
+
+
+
+ {{ __('Show') }} Resource Skill +
+ +
+ +
+ +
+ Resources Id: + {{ $resourceSkill->resources_id }} +
+
+ Skills Id: + {{ $resourceSkill->skills_id }} +
+
+ Proficiency Levels: + {{ $resourceSkill->proficiency_levels }} +
+ +
+
+
+
+
+@endsection diff --git a/resources/views/resource/show.blade.php b/resources/views/resource/show.blade.php index 85f07f42..36f69e48 100644 --- a/resources/views/resource/show.blade.php +++ b/resources/views/resource/show.blade.php @@ -35,6 +35,31 @@
+
+
+
+ {{ __('Skills and Proficiencies') }} +
+ +
+ +
+ @if ($skills->isNotEmpty()) +
    + @foreach ($skills as $skill) +
  • + {{ $skill->name }}: {{ $skill->proficiency_level }} +
  • + @endforeach +
+ @else +

{{ __('No skills allocated.') }}

+ @endif +
+
+
diff --git a/routes/web.php b/routes/web.php index a83198cf..7e1601f1 100644 --- a/routes/web.php +++ b/routes/web.php @@ -9,6 +9,7 @@ use App\Http\Controllers\LeaveController; use App\Http\Controllers\ProjectController; use App\Http\Controllers\SkillController; +use App\Http\Controllers\ResourceSkillController; /* |-------------------------------------------------------------------------- @@ -25,7 +26,7 @@ return view('welcome'); }); -Auth::routes(); +// Auth::routes(); Route::get('/home', [HomeController::class, 'index'])->name('home'); Route::resource('allocations', AllocationController::class); @@ -40,3 +41,5 @@ Route::get('/resources/{resource}/allocations', [ResourceController::class, 'allocations'])->name('resources.allocations'); Route::resource('skills', SkillController::class); +Route::resource('resource-skills', ResourceSkillController::class); + From 6bce13d22a5d1657687ce37ed120bc7b780081b5 Mon Sep 17 00:00:00 2001 From: bret Date: Tue, 12 Nov 2024 07:54:18 +0000 Subject: [PATCH 6/6] showing skills in resource now --- app/Http/Controllers/ResourceController.php | 17 ++++++++++++++--- .../Controllers/ResourceSkillController.php | 9 ++++----- app/Http/Requests/SkillRequest.php | 1 + resources/views/resource-skill/form.blade.php | 9 +++++---- resources/views/resource/show.blade.php | 6 +++--- 5 files changed, 27 insertions(+), 15 deletions(-) diff --git a/app/Http/Controllers/ResourceController.php b/app/Http/Controllers/ResourceController.php index cc7bed7f..e8f69a1f 100644 --- a/app/Http/Controllers/ResourceController.php +++ b/app/Http/Controllers/ResourceController.php @@ -157,9 +157,20 @@ public function show($id): View $resource = Resource::find($id); // Get the skills for the resource - $skills = ResourceSkill::where('resources_id', $id)->pluck('skills_id'); - $skills = Skill::whereIn('id', $skills)->get(); - + $resourceSkills = ResourceSkill::where('resources_id', $id) + ->select('skills_id', 'proficiency_levels') + ->pluck( 'proficiency_levels', 'skills_id') + ->toArray(); + + $skills = Skill::whereIn('id', array_keys($resourceSkills))->get(['id', 'skill_name']); + foreach ($resourceSkills as $skillId => $proficiencyLevel) { + $resourceSkills[$skillId] = [ + 'proficiency_level' => $proficiencyLevel, + 'skill_name' => $skills->firstWhere('id', $skillId)->skill_name, + ]; + } + $skills = $resourceSkills; + return view('resource.show', compact('resource', 'skills')); } diff --git a/app/Http/Controllers/ResourceSkillController.php b/app/Http/Controllers/ResourceSkillController.php index f3136df4..227a40ea 100644 --- a/app/Http/Controllers/ResourceSkillController.php +++ b/app/Http/Controllers/ResourceSkillController.php @@ -32,18 +32,17 @@ public function index(Request $request): View */ public function create(Request $request): View { - Log::info("in create"); - $resourceId = $request->query('resource_id'); + $resourceId = $request->query('id'); $resource = null; if ($resourceId) { $resource = Resource::findOrFail($resourceId); - Log::info("resource id = " . $resource->full_name); + // Log::info("resource id = " . $resource->full_name); $skills = ResourceSkill::where('resources_id', $resource->id)->get(); $allSkills = Skill::all(); - $unassignedSkills = $allSkills->diff($skills->toArray()); - + $unassignedSkills = $allSkills->diff($skills); + // Log::info("unassigned skills = " . print_r($unassignedSkills, true)); $resources = null; } else { diff --git a/app/Http/Requests/SkillRequest.php b/app/Http/Requests/SkillRequest.php index 1e064547..fa4e96ee 100644 --- a/app/Http/Requests/SkillRequest.php +++ b/app/Http/Requests/SkillRequest.php @@ -25,6 +25,7 @@ public function rules(): array 'skill_name' => 'required|string', 'skill_description' => 'string', 'sfia_code' => 'string', + 'sfia_level' => 'integer', ]; } } diff --git a/resources/views/resource-skill/form.blade.php b/resources/views/resource-skill/form.blade.php index f7ef5f2e..77b49e9f 100644 --- a/resources/views/resource-skill/form.blade.php +++ b/resources/views/resource-skill/form.blade.php @@ -21,7 +21,7 @@ {!! $errors->first('skills_id', '') !!} @@ -30,9 +30,10 @@ {!! $errors->first('proficiency_levels', '') !!} diff --git a/resources/views/resource/show.blade.php b/resources/views/resource/show.blade.php index 36f69e48..4373ef6f 100644 --- a/resources/views/resource/show.blade.php +++ b/resources/views/resource/show.blade.php @@ -41,16 +41,16 @@ {{ __('Skills and Proficiencies') }}
- @if ($skills->isNotEmpty()) + @if (count($skills) > 0)
    @foreach ($skills as $skill)
  • - {{ $skill->name }}: {{ $skill->proficiency_level }} + {{ $skill['skill_name'] }}: {{ $skill['proficiency_level'] }}
  • @endforeach