* Sort the aircraft by putting the bidded aircraft on top * Style fixes * If there's an aircraft on a bid, return only that * Filter selected aircraft for bids * Style fixes * Fix filtering * Style fix * Unused parameters * Use mysq * Use a root password * Add wait for mysql * wait fix * Fix password * Root password * Update the mysqladmin ping command * Change mysql host * Fix passwsrd
53 lines
1.0 KiB
PHP
53 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Contracts\Model;
|
|
use Carbon\Carbon;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
/**
|
|
* @property int user_id
|
|
* @property string flight_id
|
|
* @property int aircraft_id
|
|
* @property Carbon created_at
|
|
* @property Carbon updated_at
|
|
* @property Aircraft aircraft
|
|
* @property Flight flight
|
|
* @property User user
|
|
* @property mixed flights
|
|
*/
|
|
class Bid extends Model
|
|
{
|
|
public $table = 'bids';
|
|
|
|
protected $fillable = [
|
|
'user_id',
|
|
'flight_id',
|
|
'aircraft_id',
|
|
];
|
|
|
|
protected $casts = [
|
|
'user_id' => 'integer',
|
|
'aircraft_id' => 'integer',
|
|
];
|
|
|
|
/**
|
|
* Relationships
|
|
*/
|
|
public function aircraft(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Aircraft::class, 'aircraft_id');
|
|
}
|
|
|
|
public function flight(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Flight::class, 'flight_id');
|
|
}
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'user_id');
|
|
}
|
|
}
|