|
|
@@ -4,34 +4,35 @@
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
+use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
|
|
/**
|
|
|
* @property int $id
|
|
|
+ * @property int $unit_id
|
|
|
+ * @property string $holiday_date
|
|
|
+ * @property string $description
|
|
|
* @property \Carbon\Carbon $created_at
|
|
|
* @property \Carbon\Carbon $updated_at
|
|
|
+ * @property \Carbon\Carbon|null $deleted_at
|
|
|
*/
|
|
|
class Holiday extends Model
|
|
|
{
|
|
|
- use HasFactory;
|
|
|
+ use HasFactory, SoftDeletes;
|
|
|
|
|
|
protected $table = 'holidays';
|
|
|
|
|
|
- protected $guarded = [
|
|
|
- 'id', // Add more fields that shouldn't be edited here
|
|
|
- ];
|
|
|
+ protected $guarded = ['id'];
|
|
|
|
|
|
protected $casts = [
|
|
|
- 'created_at' => 'datetime',
|
|
|
- 'updated_at' => 'datetime',
|
|
|
- // Add your casts here (e.g., 'is_active' => 'boolean')
|
|
|
+ 'holiday_date' => 'date',
|
|
|
+ 'created_at' => 'datetime',
|
|
|
+ 'updated_at' => 'datetime',
|
|
|
+ 'deleted_at' => 'datetime',
|
|
|
];
|
|
|
|
|
|
- // Relationships
|
|
|
-
|
|
|
- // Business Logic Methods
|
|
|
-
|
|
|
- // Custom Finders
|
|
|
-
|
|
|
- // Query Scopes
|
|
|
-
|
|
|
+ public function unit(): BelongsTo
|
|
|
+ {
|
|
|
+ return $this->belongsTo(Unit::class);
|
|
|
+ }
|
|
|
}
|