fix : complete Activity log in admin side
This commit is contained in:
+59
-40
@@ -41,64 +41,73 @@ use Illuminate\Database\Eloquent\Model;
|
||||
*/
|
||||
class Flight extends Model
|
||||
{
|
||||
protected $table = 'flights';
|
||||
protected $table = 'flights';
|
||||
|
||||
protected $casts = [
|
||||
'file_id' => 'int',
|
||||
'airline_id' => 'int',
|
||||
'flight_type' => 'int',
|
||||
'departure_time' => 'datetime',
|
||||
'departure_airport_id' => 'int',
|
||||
'arrival_airport_id' => 'int',
|
||||
'price' => 'float',
|
||||
'capacity' => 'int',
|
||||
protected $casts = [
|
||||
'file_id' => 'int',
|
||||
'airline_id' => 'int',
|
||||
'flight_type' => 'int',
|
||||
'departure_time' => 'datetime',
|
||||
'departure_airport_id' => 'int',
|
||||
'arrival_airport_id' => 'int',
|
||||
'price' => 'float',
|
||||
'capacity' => 'int',
|
||||
'views' => 'int',
|
||||
'status' => FlightStatus::class
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'file_id',
|
||||
'airline_id',
|
||||
'flight_type',
|
||||
'departure_time',
|
||||
'departure_airport_id',
|
||||
'arrival_airport_id',
|
||||
'price',
|
||||
'summary',
|
||||
'capacity',
|
||||
'description',
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'file_id',
|
||||
'airline_id',
|
||||
'flight_type',
|
||||
'departure_time',
|
||||
'departure_airport_id',
|
||||
'arrival_airport_id',
|
||||
'price',
|
||||
'summary',
|
||||
'capacity',
|
||||
'description',
|
||||
'views',
|
||||
'status'
|
||||
];
|
||||
'status',
|
||||
'created_by',
|
||||
'updated_by',
|
||||
];
|
||||
|
||||
public function airline()
|
||||
{
|
||||
return $this->belongsTo(Airline::class);
|
||||
}
|
||||
protected $hidden = [
|
||||
'created_by',
|
||||
'updated_by',
|
||||
];
|
||||
public function airline()
|
||||
{
|
||||
return $this->belongsTo(Airline::class);
|
||||
}
|
||||
|
||||
public function file()
|
||||
{
|
||||
return $this->belongsTo(File::class);
|
||||
}
|
||||
public function file()
|
||||
{
|
||||
return $this->belongsTo(File::class);
|
||||
}
|
||||
|
||||
public function airport()
|
||||
{
|
||||
return $this->belongsTo(Airport::class, 'departure_airport_id');
|
||||
}
|
||||
public function airport()
|
||||
{
|
||||
return $this->belongsTo(Airport::class, 'departure_airport_id');
|
||||
}
|
||||
|
||||
public function bookings()
|
||||
{
|
||||
return $this->hasMany(Booking::class);
|
||||
}
|
||||
|
||||
public function bookings()
|
||||
{
|
||||
return $this->hasMany(Booking::class);
|
||||
}
|
||||
public function arrivalAirport()
|
||||
{
|
||||
return $this->belongsTo(Airport::class, 'arrival_airport_id');
|
||||
}
|
||||
|
||||
public function departureAirport()
|
||||
{
|
||||
return $this->belongsTo(Airport::class, 'departure_airport_id');
|
||||
}
|
||||
|
||||
public function comments()
|
||||
{
|
||||
return $this->hasMany(Comment::class, 'flight_id');
|
||||
@@ -113,4 +122,14 @@ class Flight extends Model
|
||||
$query->where('flight_type', $request->input('flight_type'));
|
||||
}
|
||||
}
|
||||
|
||||
public function creator()
|
||||
{
|
||||
return $this->belongsTo(Admin::class, 'created_by');
|
||||
}
|
||||
|
||||
public function updater()
|
||||
{
|
||||
return $this->belongsTo(Admin::class, 'updated_by');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user