Only show flights if they're also marked as visible

This commit is contained in:
Nabeel Shahzad
2018-07-12 22:29:50 -05:00
parent 4ca58ed754
commit 0af85a3fff
4 changed files with 22 additions and 6 deletions

View File

@@ -44,7 +44,11 @@ class FlightController extends Controller
{
$user = Auth::user();
$where = ['active' => true];
$where = [
'active' => true,
'visible' => true,
];
if(setting('pilots.restrict_to_company')) {
$where['airline_id'] = Auth::user()->airline_id;
}
@@ -84,7 +88,11 @@ class FlightController extends Controller
$user = Auth::user();
try {
$where = ['active' => true];
$where = [
'active' => true,
'visible' => true,
];
if(setting('pilots.restrict_to_company')) {
$where['airline_id'] = Auth::user()->airline_id;
}

View File

@@ -52,8 +52,10 @@ class FlightController extends Controller
public function index(Request $request)
{
$where = [
'active' => true,
'active' => true,
'visible' => true,
];
if(setting('pilots.restrict_to_company')) {
$where['airline_id'] = Auth::user()->airline_id;
}