Ejemplo n.º 1
0
 function update(Airport $airport)
 {
     Diff::compare($airport, Input::all(), function ($key, $value, $model) {
         $change = new AirportChange();
         $change->airport_id = $model->id;
         $change->user_id = Auth::id();
         $change->key = $key;
         $change->value = $value;
         $change->save();
     });
     Messages::success('Thank you for your submission. We will be evaluating your feedback soon.');
     return Redirect::route('airport.show', $airport->icao);
 }
Ejemplo n.º 2
0
    return strlen($output) > 0 ? trim($output) : $default;
}
View::composer('layouts.admin', function ($view) {
    if (!is_null($team = Auth::user()->team)) {
        $user = array('name' => $team->name, 'firstname' => !empty($team->firstname) ? $team->firstname : explode(' ', $team->name)[0], 'job' => $team->job, 'photo' => $team->photo);
    } else {
        $team = Auth::user();
        $user = array('name' => $team->name, 'firstname' => explode(' ', $team->name)[0], 'job' => '', 'photo' => false);
    }
    $view->with('user', $user);
});
View::composer(['layouts.master', 'layouts.errors'], function ($view) {
    $view->with('build', substr(File::get(base_path() . '/.git/' . trim(substr(File::get(base_path() . '/.git/HEAD'), 5))), 0, 7));
    $view->with('statsPilots', Cache::get('vatsim.pilots'));
    $view->with('statsAtc', Cache::get('vatsim.atc'));
});
View::composer(['layouts.master', 'flight.show', 'atc.show'], function ($view) {
    $view->with('mapstyle', Auth::guest() || is_null(Auth::user()->map) ? 'blue' : Auth::user()->map);
});
View::composer('admin._partials.sidebar', function ($view) {
    $view->with('airlineRequestCount', count(AirlineChange::groupBy('airline_id')->remember(1)->lists('airline_id')));
    $view->with('airportRequestCount', count(AirportChange::groupBy('airport_id')->remember(1)->lists('airport_id')));
});
View::composer('admin._partials.tasks', function ($view) {
    if (!is_null($team = Auth::user()->team) && !is_null($team->jira)) {
        $tasks = JiraIssue::where('assignee', $team->jira)->where('resolution', 'Unresolved')->orderBy('priority', 'desc')->orderBy('updatedDate', 'DESC')->get();
    } else {
        $tasks = false;
    }
    $view->with('tasks', $tasks);
});