diff --git a/app/Http/Controllers/FilamentTypeController.php b/app/Http/Controllers/FilamentTypeController.php new file mode 100644 index 0000000..1b458ef --- /dev/null +++ b/app/Http/Controllers/FilamentTypeController.php @@ -0,0 +1,87 @@ +name = $request->name; + $type->description = $request->description; + $type->save(); + return redirect()->route('types.index'); + } + + /** + * Display the specified resource. + */ + public function show(string $id) + { + // Show Single Type + $type = FilamentType::find($id); + + + return view('types.show', compact('type')); + } + + /** + * Show the form for editing the specified resource. + */ + public function edit(string $id) + { + // + $type = FilamentType::find($id); + return view('types.edit', compact('type')); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, string $id) + { + // Store updated type + $type = FilamentType::find($id); + $type->name = $request->name; + $type->description = $request->description; + $type->save(); + return redirect()->route('types.show', $type->id); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(string $id) + { + // Delete Type + $type = FilamentType::find($id); + $type->delete(); + return redirect()->route('types.index')->with('success','Type deleted successfully.'); + + } +} diff --git a/app/Livewire/CreateFilamentType.php b/app/Livewire/CreateFilamentType.php new file mode 100644 index 0000000..1a4d9eb --- /dev/null +++ b/app/Livewire/CreateFilamentType.php @@ -0,0 +1,26 @@ +only(['name', 'description']) + ); + session()->flash('status', 'Filament Type Created Successfully.'); + return redirect()->route('filamenttype.list'); + } + public function render() + { + return view('filamenttype.create'); + } +} diff --git a/app/Models/FilamentType.php b/app/Models/FilamentType.php new file mode 100644 index 0000000..bbb0592 --- /dev/null +++ b/app/Models/FilamentType.php @@ -0,0 +1,15 @@ +id(); + $table->timestamps(); + $table->string('name'); + $table->string('description'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('filament_types'); + } +}; diff --git a/resources/css/app.css b/resources/css/app.css index 5173eb6..0624d14 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -11,6 +11,10 @@ --font-sans: Inter, ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; + + --color-accent: var(--color-rose-500); + --color-accent-content: var(--color-rose-500); + --color-accent-foreground: var(--color-white); } /* @@ -31,6 +35,14 @@ } } +@layer theme { + .dark { + --color-accent: var(--color-rose-500); + --color-accent-content: var(--color-rose-400); + --color-accent-foreground: var(--color-white); + } +} + [x-cloak] { display: none; } diff --git a/resources/views/components/layouts/app.blade.php b/resources/views/components/layouts/app.blade.php new file mode 100644 index 0000000..68ba638 --- /dev/null +++ b/resources/views/components/layouts/app.blade.php @@ -0,0 +1,12 @@ + + + + + + + {{ $title ?? 'Page Title' }} + + + {{ $slot }} + + diff --git a/resources/views/components/navbar.blade.php b/resources/views/components/navbar.blade.php index 6ac7641..d2714d8 100644 --- a/resources/views/components/navbar.blade.php +++ b/resources/views/components/navbar.blade.php @@ -5,10 +5,10 @@