Refactor Filament resources and models; add attribute casting in Group model, update navigation icons, and remove TeacherSeeder in favor of UserTableSeeder.

This commit is contained in:
2025-08-31 12:52:31 +05:00
parent 710554a28d
commit 6b6f358aa7
13 changed files with 200 additions and 30 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
@@ -19,6 +20,21 @@ class Group extends Model
{
use HasFactory;
/**
* @var array<string, string>
*/
protected $casts = [
'start_date' => 'date',
'end_date' => 'date',
];
public function name(): Attribute
{
return Attribute::make(
get: fn ($value) => $this->start_date->format('d M') . ' - ' . $this->end_date->format('d M'),
);
}
public function pilgrims(): HasMany
{
return $this->hasMany(Pilgrim::class);