fares & aircraft fares
This commit is contained in:
@@ -62,4 +62,9 @@ class Aircraft extends Model
|
||||
'aircraft_class_id'
|
||||
);
|
||||
}
|
||||
|
||||
public function fares() {
|
||||
# aircraft_fare == table name
|
||||
return $this->belongsToMany('App\Models\Fare', 'aircraft_fare');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,5 +44,4 @@ class Airlines extends Model
|
||||
'name' => 'required',
|
||||
];
|
||||
|
||||
|
||||
}
|
||||
|
||||
30
app/Services/AircraftFareService.php
Normal file
30
app/Services/AircraftFareService.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Repositories\FareRepository;
|
||||
use App\Repositories\AircraftRepository;
|
||||
|
||||
|
||||
class AircraftFareService {
|
||||
|
||||
protected $aircraft, $fare;
|
||||
|
||||
/**
|
||||
* return a PIREP model
|
||||
* @param $aircraft AircraftRepository
|
||||
* @param $fare FareRepository
|
||||
*/
|
||||
public function __construct(AircraftRepository $aircraft, FareRepository $fare) {
|
||||
$this->fare = $fare;
|
||||
$this->aircraft = $aircraft;
|
||||
}
|
||||
|
||||
public function link(int $aircraft_id, int $fare_id) {
|
||||
|
||||
}
|
||||
|
||||
public function unlink(int $aircraft_id, int $fare_id) {
|
||||
|
||||
}
|
||||
}
|
||||
24
app/Services/PIREPService.php
Normal file
24
app/Services/PIREPService.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Repositories\AircraftRepository;
|
||||
|
||||
|
||||
class PIREPService {
|
||||
|
||||
protected $aircraft;
|
||||
|
||||
/**
|
||||
* return a PIREP model
|
||||
*/
|
||||
public function __construct(
|
||||
AircraftRepository $aircraft
|
||||
) {
|
||||
$this->aircraft = $aircraft;
|
||||
}
|
||||
|
||||
public function create() {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user