File manager - Edit - /var/www/html/spdc/api/app/Models/BDT.php
Back
<?php namespace App\Models; use App\Casts\Boolean; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Concerns\HasUuids; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\BelongsToMany; class BDT extends BaseModel { use HasFactory; use HasUuids; protected $table = 'bdts'; protected $fillable = [ 'schedule_id', 'finished', 'tank_completed', ]; protected $casts = [ 'finished' => Boolean::class, 'tank_completed' => Boolean::class, ]; /** * Get the transportation that owns the BDT * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function transportation(): BelongsTo { return $this->belongsTo(Transportation::class); } /** * Get the driver that owns the BDT * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function driver(): BelongsTo { return $this->belongsTo(User::class, 'driver_id'); } /** * Get the schedule that owns the BDT * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function schedule(): BelongsTo { return $this->belongsTo(Schedule::class); } /** * Get all of the supplies for the BDT * * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function supplies(): HasMany { return $this->hasMany(TransportationSupply::class, 'bdt_id'); } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings