2017-06-11 07:27:19 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Services;
|
|
|
|
|
|
|
|
use App\Models\AircraftClass;
|
|
|
|
use Dompdf\Exception;
|
|
|
|
|
|
|
|
class AircraftService extends BaseService
|
|
|
|
{
|
|
|
|
|
|
|
|
public function create(
|
2017-07-04 14:05:37 +08:00
|
|
|
array $attributes
|
2017-06-11 07:27:19 +08:00
|
|
|
) {
|
|
|
|
|
2017-06-24 06:33:18 +08:00
|
|
|
$repo = app('App\Repositories\SubfleetRepository');
|
2017-06-11 07:27:19 +08:00
|
|
|
try {
|
|
|
|
$model = $repo->create($attributes);
|
|
|
|
} catch (Exception $e) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-07-04 14:05:37 +08:00
|
|
|
/*if ($class != null) {
|
2017-06-11 07:27:19 +08:00
|
|
|
$model->class()->associate($class);
|
|
|
|
$model->save();
|
2017-07-04 14:05:37 +08:00
|
|
|
}*/
|
2017-06-11 07:27:19 +08:00
|
|
|
|
|
|
|
return $model;
|
|
|
|
}
|
|
|
|
}
|