#21 PIREP scaffolding
This commit is contained in:
@@ -14,3 +14,5 @@ DB_USERNAME=
|
|||||||
DB_PASSWORD=
|
DB_PASSWORD=
|
||||||
|
|
||||||
CACHE_DRIVER=array
|
CACHE_DRIVER=array
|
||||||
|
|
||||||
|
PHPVMS_CURRENCY=dollar
|
||||||
|
|||||||
8
.htaccess
Normal file
8
.htaccess
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# Disable index view
|
||||||
|
Options -Indexes
|
||||||
|
|
||||||
|
# Hide a specific file
|
||||||
|
<Files .env>
|
||||||
|
Order allow,deny
|
||||||
|
Deny from all
|
||||||
|
</Files>
|
||||||
@@ -53,6 +53,7 @@ class Aircraft extends Model
|
|||||||
/**
|
/**
|
||||||
* foreign keys
|
* foreign keys
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function airport()
|
public function airport()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('App\Models\Airport', 'airport_id');
|
return $this->belongsTo('App\Models\Airport', 'airport_id');
|
||||||
|
|||||||
@@ -51,4 +51,28 @@ class User extends Authenticatable
|
|||||||
protected $hidden = [
|
protected $hidden = [
|
||||||
'password', 'remember_token',
|
'password', 'remember_token',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Foreign Keys
|
||||||
|
*/
|
||||||
|
|
||||||
|
public function airline()
|
||||||
|
{
|
||||||
|
return $this->belongsTo('App\Models\Airline', 'airline_id');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function home_airport()
|
||||||
|
{
|
||||||
|
return $this->belongsTo('App\Models\Airport', 'home_airport_id');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function current_airport()
|
||||||
|
{
|
||||||
|
return $this->belongsTo('App\Models\Airport', 'curr_airport_id');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function rank()
|
||||||
|
{
|
||||||
|
return $this->belongsTo('App\Models\Rank', 'rank_id');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
24
app/Repositories/PirepFieldRepository.php
Normal file
24
app/Repositories/PirepFieldRepository.php
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Repositories;
|
||||||
|
|
||||||
|
use App\Models\PirepField;
|
||||||
|
use InfyOm\Generator\Common\BaseRepository;
|
||||||
|
|
||||||
|
class PirepFieldRepository extends BaseRepository
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $fieldSearchable = [
|
||||||
|
'name'
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configure the Model
|
||||||
|
**/
|
||||||
|
public function model()
|
||||||
|
{
|
||||||
|
return PirepField::class;
|
||||||
|
}
|
||||||
|
}
|
||||||
24
app/Repositories/PirepRepository.php
Normal file
24
app/Repositories/PirepRepository.php
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Repositories;
|
||||||
|
|
||||||
|
use App\Models\Pirep;
|
||||||
|
use InfyOm\Generator\Common\BaseRepository;
|
||||||
|
|
||||||
|
class PirepRepository extends BaseRepository
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $fieldSearchable = [
|
||||||
|
'user_id'
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configure the Model
|
||||||
|
**/
|
||||||
|
public function model()
|
||||||
|
{
|
||||||
|
return Pirep::class;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,20 +2,23 @@
|
|||||||
|
|
||||||
namespace App\Services;
|
namespace App\Services;
|
||||||
|
|
||||||
|
use App\Repositories\PirepRepository;
|
||||||
use App\Repositories\SubfleetRepository;
|
use App\Repositories\SubfleetRepository;
|
||||||
|
|
||||||
|
|
||||||
class PIREPService extends BaseService {
|
class PIREPService extends BaseService {
|
||||||
|
|
||||||
protected $aircraft;
|
protected $aircraftRepo, $pirepRepo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return a PIREP model
|
* return a PIREP model
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
SubfleetRepository $aircraft
|
SubfleetRepository $aircraftRepo,
|
||||||
|
PirepRepository $pirepRepo
|
||||||
) {
|
) {
|
||||||
$this->aircraft = $aircraft;
|
$this->aircraftRepo = $aircraftRepo;
|
||||||
|
$this->pirepRepo = $pirepRepo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function create() {
|
public function create() {
|
||||||
|
|||||||
@@ -13,6 +13,8 @@
|
|||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phenx/php-font-lib" />
|
<excludeFolder url="file://$MODULE_DIR$/vendor/phenx/php-font-lib" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phenx/php-svg-lib" />
|
<excludeFolder url="file://$MODULE_DIR$/vendor/phenx/php-svg-lib" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpoffice/phpexcel" />
|
<excludeFolder url="file://$MODULE_DIR$/vendor/phpoffice/phpexcel" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/spatie/fractalistic" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/vendor/spatie/laravel-fractal" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php56" />
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php56" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-util" />
|
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-util" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/vendor/webpatser/laravel-uuid" />
|
<excludeFolder url="file://$MODULE_DIR$/vendor/webpatser/laravel-uuid" />
|
||||||
@@ -44,6 +46,8 @@
|
|||||||
<root url="file://$MODULE_DIR$/vendor/phenx/php-font-lib" />
|
<root url="file://$MODULE_DIR$/vendor/phenx/php-font-lib" />
|
||||||
<root url="file://$MODULE_DIR$/vendor/phenx/php-svg-lib" />
|
<root url="file://$MODULE_DIR$/vendor/phenx/php-svg-lib" />
|
||||||
<root url="file://$MODULE_DIR$/vendor/phpoffice/phpexcel" />
|
<root url="file://$MODULE_DIR$/vendor/phpoffice/phpexcel" />
|
||||||
|
<root url="file://$MODULE_DIR$/vendor/spatie/fractalistic" />
|
||||||
|
<root url="file://$MODULE_DIR$/vendor/spatie/laravel-fractal" />
|
||||||
<root url="file://$MODULE_DIR$/vendor/symfony/polyfill-php56" />
|
<root url="file://$MODULE_DIR$/vendor/symfony/polyfill-php56" />
|
||||||
<root url="file://$MODULE_DIR$/vendor/symfony/polyfill-util" />
|
<root url="file://$MODULE_DIR$/vendor/symfony/polyfill-util" />
|
||||||
<root url="file://$MODULE_DIR$/vendor/webpatser/laravel-uuid" />
|
<root url="file://$MODULE_DIR$/vendor/webpatser/laravel-uuid" />
|
||||||
@@ -62,6 +66,8 @@
|
|||||||
<root url="file://$MODULE_DIR$/vendor/phenx/php-font-lib" />
|
<root url="file://$MODULE_DIR$/vendor/phenx/php-font-lib" />
|
||||||
<root url="file://$MODULE_DIR$/vendor/phenx/php-svg-lib" />
|
<root url="file://$MODULE_DIR$/vendor/phenx/php-svg-lib" />
|
||||||
<root url="file://$MODULE_DIR$/vendor/phpoffice/phpexcel" />
|
<root url="file://$MODULE_DIR$/vendor/phpoffice/phpexcel" />
|
||||||
|
<root url="file://$MODULE_DIR$/vendor/spatie/fractalistic" />
|
||||||
|
<root url="file://$MODULE_DIR$/vendor/spatie/laravel-fractal" />
|
||||||
<root url="file://$MODULE_DIR$/vendor/symfony/polyfill-php56" />
|
<root url="file://$MODULE_DIR$/vendor/symfony/polyfill-php56" />
|
||||||
<root url="file://$MODULE_DIR$/vendor/symfony/polyfill-util" />
|
<root url="file://$MODULE_DIR$/vendor/symfony/polyfill-util" />
|
||||||
<root url="file://$MODULE_DIR$/vendor/webpatser/laravel-uuid" />
|
<root url="file://$MODULE_DIR$/vendor/webpatser/laravel-uuid" />
|
||||||
|
|||||||
Reference in New Issue
Block a user