Update project dependencies and configuration
- Added Filament and Tailwind CSS dependencies in composer.json. - Updated AGENTS.md to include new package versions. - Modified boost.json to include tailwindcss-development skill. - Updated DatabaseSeeder to create an admin user with a password. - Changed the root route to use HomeController instead of a closure. - Adjusted permissions for .gitignore in storage directory.
This commit is contained in:
20
app/Models/CarouselSlide.php
Normal file
20
app/Models/CarouselSlide.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class CarouselSlide extends Model
|
||||
{
|
||||
protected $fillable = ['image', 'title', 'subtitle', 'order', 'is_active'];
|
||||
|
||||
protected static function booted(): void
|
||||
{
|
||||
static::deleting(function (CarouselSlide $slide) {
|
||||
if ($slide->image) {
|
||||
Storage::disk('public')->delete($slide->image);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
16
app/Models/Category.php
Normal file
16
app/Models/Category.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class Category extends Model
|
||||
{
|
||||
protected $fillable = ['name', 'icon', 'order'];
|
||||
|
||||
public function products(): HasMany
|
||||
{
|
||||
return $this->hasMany(Product::class);
|
||||
}
|
||||
}
|
||||
20
app/Models/Collection.php
Normal file
20
app/Models/Collection.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class Collection extends Model
|
||||
{
|
||||
protected $fillable = ['title', 'subtitle', 'image', 'order', 'is_active'];
|
||||
|
||||
protected static function booted(): void
|
||||
{
|
||||
static::deleting(function (Collection $collection) {
|
||||
if ($collection->image) {
|
||||
Storage::disk('public')->delete($collection->image);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
26
app/Models/Product.php
Normal file
26
app/Models/Product.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class Product extends Model
|
||||
{
|
||||
protected $fillable = ['category_id', 'name', 'description', 'price', 'image', 'is_active'];
|
||||
|
||||
public function category(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Category::class);
|
||||
}
|
||||
|
||||
protected static function booted(): void
|
||||
{
|
||||
static::deleting(function (Product $product) {
|
||||
if ($product->image) {
|
||||
Storage::disk('public')->delete($product->image);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user