Fixed scoping rules in Model classes

This commit is contained in:
Nabeel Shahzad
2018-03-20 19:40:19 -05:00
parent b9beb6c804
commit bb5bb4d4c7
25 changed files with 103 additions and 102 deletions

View File

@@ -25,7 +25,7 @@ class Aircraft extends Model
public $table = 'aircraft';
public $fillable = [
protected $fillable = [
'subfleet_id',
'airport_id',
'name',

View File

@@ -29,7 +29,7 @@ class Airline extends Model
*/
public $journal_type = JournalType::AIRLINE;
public $fillable = [
protected $fillable = [
'icao',
'iata',
'name',

View File

@@ -21,7 +21,7 @@ class Airport extends Model
public $timestamps = false;
public $incrementing = false;
public $fillable = [
protected $fillable = [
'id',
'iata',
'icao',

View File

@@ -15,7 +15,7 @@ class Award extends Model
{
public $table = 'awards';
public $fillable = [
protected $fillable = [
'name',
'description',
'image_url',

View File

@@ -11,7 +11,7 @@ class Bid extends Model
{
public $table = 'bids';
public $fillable = [
protected $fillable = [
'user_id',
'flight_id',
];

View File

@@ -16,7 +16,7 @@ class Expense extends Model
{
public $table = 'expenses';
public $fillable = [
protected $fillable = [
'airline_id',
'name',
'amount',

View File

@@ -15,7 +15,7 @@ class Fare extends Model
{
public $table = 'fares';
public $fillable = [
protected $fillable = [
'code',
'name',
'price',

View File

@@ -27,7 +27,7 @@ class Flight extends Model
/** The form wants this */
public $hours, $minutes;
public $fillable = [
protected $fillable = [
'id',
'airline_id',
'flight_number',

View File

@@ -15,7 +15,7 @@ class FlightField extends Model
public $table = 'flight_fields';
public $timestamps = false;
public $fillable = [
protected $fillable = [
'name',
'slug',
'required',

View File

@@ -15,7 +15,7 @@ class FlightFieldValue extends Model
{
public $table = 'flight_field_values';
public $fillable = [
protected $fillable = [
'flight_id',
'name',
'value',

View File

@@ -26,7 +26,7 @@ class Journal extends Model
{
protected $table = 'journals';
public $fillable = [
protected $fillable = [
'ledger_id',
'journal_type',
'balance',

View File

@@ -26,7 +26,7 @@ class JournalTransaction extends Model
public $incrementing = false;
public $fillable = [
protected $fillable = [
'transaction_group',
'journal_id',
'credit',

View File

@@ -21,7 +21,7 @@ use Carbon\Carbon;
*/
class Ledger extends Model
{
protected $table = 'ledgers';
public $table = 'ledgers';
/**
*

View File

@@ -11,10 +11,11 @@ use App\Interfaces\Model;
class Navdata extends Model
{
public $table = 'navdata';
public $timestamps = false;
public $incrementing = false;
public $fillable = [
protected $fillable = [
'id',
'name',
'type',
@@ -23,7 +24,7 @@ class Navdata extends Model
'freq',
];
public $casts = [
protected $casts = [
'type' => 'integer',
'lat' => 'float',
'lon' => 'float',

View File

@@ -12,7 +12,7 @@ class News extends Model
{
public $table = 'news';
public $fillable = [
protected $fillable = [
'user_id',
'subject',
'body',

View File

@@ -40,7 +40,7 @@ class Pirep extends Model
/** The form wants this */
public $hours, $minutes;
public $fillable = [
protected $fillable = [
'id',
'user_id',
'airline_id',

View File

@@ -13,7 +13,7 @@ class PirepComment extends Model
{
public $table = 'pirep_comments';
public $fillable = [
protected $fillable = [
'pirep_id',
'user_id',
'comment',

View File

@@ -13,7 +13,7 @@ class PirepFare extends Model
public $table = 'pirep_fares';
public $timestamps = false;
public $fillable = [
protected $fillable = [
'pirep_id',
'fare_id',
'count',

View File

@@ -15,7 +15,7 @@ class PirepField extends Model
public $table = 'pirep_fields';
public $timestamps = false;
public $fillable = [
protected $fillable = [
'name',
'slug',
'required',

View File

@@ -12,7 +12,7 @@ class PirepFieldValues extends Model
{
public $table = 'pirep_field_values';
public $fillable = [
protected $fillable = [
'pirep_id',
'name',
'value',

View File

@@ -15,7 +15,7 @@ class Rank extends Model
{
public $table = 'ranks';
public $fillable = [
protected $fillable = [
'name',
'hours',
'image_url',

View File

@@ -21,7 +21,7 @@ class Setting extends Model
public $table = 'settings';
public $incrementing = false;
public $fillable = [
protected $fillable = [
'name',
'key',
'value',

View File

@@ -19,7 +19,7 @@ class Subfleet extends Model
public $table = 'subfleets';
protected $fillable = [
public $fillable = [
'airline_id',
'type',
'name',
@@ -30,7 +30,7 @@ class Subfleet extends Model
'gross_weight',
];
protected $casts = [
public $casts = [
'airline_id' => 'integer',
'fuel_type' => 'integer',
'ground_handling_multiplier' => 'float',
@@ -39,7 +39,7 @@ class Subfleet extends Model
'gross_weight' => 'float',
];
protected static $rules = [
public static $rules = [
'type' => 'required|unique',
'name' => 'required',
'ground_handling_multiplier' => 'nullable|numeric',

View File

@@ -12,7 +12,7 @@ class UserAward extends Model
{
public $table = 'user_awards';
public $fillable = [
protected $fillable = [
'user_id',
'award_id'
];

150
composer.lock generated
View File

@@ -168,7 +168,7 @@
"Arrilot\\Widgets\\": "src/"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -223,7 +223,7 @@
"Cache\\Adapter\\Common\\": ""
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -291,7 +291,7 @@
"/Tests/"
]
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -353,7 +353,7 @@
"/Tests/"
]
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -408,7 +408,7 @@
"Cache\\TagInterop\\": ""
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -527,7 +527,7 @@
"Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -643,7 +643,7 @@
"Cron\\": "src/Cron/"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -703,7 +703,7 @@
"Egulias\\EmailValidator\\": "EmailValidator"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -795,7 +795,7 @@
"Firebase\\JWT\\": "src"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
@@ -863,7 +863,7 @@
"src/Google/Service/"
]
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
@@ -876,16 +876,16 @@
},
{
"name": "google/apiclient-services",
"version": "v0.50",
"version": "v0.51",
"source": {
"type": "git",
"url": "https://github.com/google/google-api-php-client-services.git",
"reference": "3e792254734e4444dd8a594e927926f28de2e609"
"reference": "c3d936baf3eacc002f6183530355fe4fba19b0fb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/google/google-api-php-client-services/zipball/3e792254734e4444dd8a594e927926f28de2e609",
"reference": "3e792254734e4444dd8a594e927926f28de2e609",
"url": "https://api.github.com/repos/google/google-api-php-client-services/zipball/c3d936baf3eacc002f6183530355fe4fba19b0fb",
"reference": "c3d936baf3eacc002f6183530355fe4fba19b0fb",
"shasum": ""
},
"require": {
@@ -909,7 +909,7 @@
"keywords": [
"google"
],
"time": "2018-03-10T00:23:06+00:00"
"time": "2018-03-18T00:23:20+00:00"
},
{
"name": "google/auth",
@@ -945,7 +945,7 @@
"Google\\Auth\\": "src"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
@@ -999,7 +999,7 @@
"GuzzleHttp\\": "src/"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -1057,7 +1057,7 @@
"src/functions_include.php"
]
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -1112,7 +1112,7 @@
"src/functions_include.php"
]
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -1174,7 +1174,7 @@
"Hashids\\": "src/"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -1309,7 +1309,7 @@
"Irazasyed\\LaravelGAMP\\": "src/"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -1356,7 +1356,7 @@
"Jackiedo\\Timezonelist\\": "src/Jackiedo/Timezonelist"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -1409,7 +1409,7 @@
"stubs/"
]
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -1460,7 +1460,7 @@
"Joshbrw\\LaravelModuleInstaller\\": "src/"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -1493,7 +1493,7 @@
"Traitor\\": "src/"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -1552,7 +1552,7 @@
"src/Laracasts/Flash/functions.php"
]
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -1753,7 +1753,7 @@
"src/helpers.php"
]
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -2028,7 +2028,7 @@
"League\\ISO3166\\": "src"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -2221,7 +2221,7 @@
"VaCentral\\": "src/"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -2229,16 +2229,16 @@
},
{
"name": "nesbot/carbon",
"version": "1.24.2",
"version": "1.25.0",
"source": {
"type": "git",
"url": "https://github.com/briannesbitt/Carbon.git",
"reference": "bba6c6e410c6b4317e37a9474aeaa753808c3875"
"reference": "cbcf13da0b531767e39eb86e9687f5deba9857b4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/bba6c6e410c6b4317e37a9474aeaa753808c3875",
"reference": "bba6c6e410c6b4317e37a9474aeaa753808c3875",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/cbcf13da0b531767e39eb86e9687f5deba9857b4",
"reference": "cbcf13da0b531767e39eb86e9687f5deba9857b4",
"shasum": ""
},
"require": {
@@ -2278,7 +2278,7 @@
"datetime",
"time"
],
"time": "2018-03-10T10:10:14+00:00"
"time": "2018-03-19T15:50:49+00:00"
},
{
"name": "nikic/php-parser",
@@ -2378,7 +2378,7 @@
"src/helpers.php"
]
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -2487,7 +2487,7 @@
"Http\\Discovery\\": "src/"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -2540,7 +2540,7 @@
"PhpUnitsOfMeasure\\": "source/"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -2599,7 +2599,7 @@
"phpseclib\\": "phpseclib/"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -2755,7 +2755,7 @@
"PragmaRX\\Yaml\\Tests\\": "tests/"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -2816,7 +2816,7 @@
"Prettus\\Repository\\": "src/Prettus/Repository/"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -2905,7 +2905,7 @@
"Psr\\Cache\\": "src/"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -3169,7 +3169,7 @@
"Ramsey\\Uuid\\": "src/"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -3452,7 +3452,7 @@
"Spatie\\Pjax\\": "src"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -4103,7 +4103,7 @@
"bootstrap.php"
]
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -4159,7 +4159,7 @@
"bootstrap.php"
]
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -4678,7 +4678,7 @@
"TheIconic\\Tracking\\GoogleAnalytics\\": "src/"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -4723,7 +4723,7 @@
"TijsVerkoyen\\CssToInlineStyles\\": "src"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
@@ -4764,7 +4764,7 @@
"Tivie\\OS\\": "src/"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"APACHE 2.0"
],
@@ -4882,7 +4882,7 @@
"src/vierbergenlars/SemVer/internal.php"
]
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -4987,7 +4987,7 @@
"Webpatser\\Uuid": "src/"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -5043,7 +5043,7 @@
"/Tests/"
]
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -5114,7 +5114,7 @@
"Barryvdh\\LaravelIdeHelper\\": "src"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -5271,7 +5271,7 @@
"Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -5341,7 +5341,7 @@
"Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -5398,7 +5398,7 @@
"Whoops\\": "src/Whoops/"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -5546,7 +5546,7 @@
"JakubOnderka\\PhpConsoleColor": "src/"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-2-Clause"
],
@@ -5590,7 +5590,7 @@
"JakubOnderka\\PhpConsoleHighlighter": "src/"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -5699,7 +5699,7 @@
"src/DeepCopy/deep_copy.php"
]
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -5715,16 +5715,16 @@
},
{
"name": "nunomaduro/collision",
"version": "v2.0.0",
"version": "v2.0.1",
"source": {
"type": "git",
"url": "https://github.com/nunomaduro/collision.git",
"reference": "4e310ef9384f53ee8dda8736afb3cbaf320753a0"
"reference": "e60011a179d97f33ee394865b1cec472247df3b9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nunomaduro/collision/zipball/4e310ef9384f53ee8dda8736afb3cbaf320753a0",
"reference": "4e310ef9384f53ee8dda8736afb3cbaf320753a0",
"url": "https://api.github.com/repos/nunomaduro/collision/zipball/e60011a179d97f33ee394865b1cec472247df3b9",
"reference": "e60011a179d97f33ee394865b1cec472247df3b9",
"shasum": ""
},
"require": {
@@ -5750,7 +5750,7 @@
"NunoMaduro\\Collision\\": "src/"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -5773,7 +5773,7 @@
"php",
"symfony"
],
"time": "2018-02-18T12:29:27+00:00"
"time": "2018-03-20T21:27:23+00:00"
},
{
"name": "phar-io/manifest",
@@ -5969,7 +5969,7 @@
]
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -6065,7 +6065,7 @@
"Prophecy\\": "src/"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -6135,7 +6135,7 @@
"src/"
]
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
@@ -6183,7 +6183,7 @@
"src/"
]
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
@@ -6274,7 +6274,7 @@
"src/"
]
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
@@ -6324,7 +6324,7 @@
"src/"
]
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
@@ -6458,7 +6458,7 @@
"src/"
]
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
@@ -6555,7 +6555,7 @@
"src/"
]
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
@@ -6618,7 +6618,7 @@
"src/"
]
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
@@ -7168,7 +7168,7 @@
"Webmozart\\Assert\\": "src/"
}
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -7222,7 +7222,7 @@
"src/functions.php"
]
},
"notification-url": "http://packagist.org/downloads/",
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache2"
],