Apply fixes from StyleCI
This commit is contained in:
@@ -1,5 +1,24 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright © 2020 Miguel Nogueira
|
||||
*
|
||||
* This file is part of Raspberry Staff Manager.
|
||||
*
|
||||
* Raspberry Staff Manager is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Raspberry Staff Manager is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Raspberry Staff Manager. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\TeamFile;
|
||||
@@ -18,9 +37,9 @@ class TeamFileController extends Controller
|
||||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
if (is_null(Auth::user()->currentTeam))
|
||||
{
|
||||
if (is_null(Auth::user()->currentTeam)) {
|
||||
$request->session()->flash('error', 'Please choose a team before viewing it\'s files.');
|
||||
|
||||
return redirect()->to(route('teams.index'));
|
||||
}
|
||||
|
||||
@@ -49,18 +68,14 @@ class TeamFileController extends Controller
|
||||
//
|
||||
}
|
||||
|
||||
|
||||
public function download(Request $request, TeamFile $teamFile)
|
||||
{
|
||||
try
|
||||
{
|
||||
return Storage::download('uploads/' . $teamFile->name);
|
||||
}
|
||||
catch (FileNotFoundException $ex)
|
||||
{
|
||||
$request->session()->flash('error', 'Sorry, but the requested file could not be found in storage. Sometimes, files may be physically deleted by admins, but not from the app\'s database.');
|
||||
return redirect()->back();
|
||||
try {
|
||||
return Storage::download('uploads/'.$teamFile->name);
|
||||
} catch (FileNotFoundException $ex) {
|
||||
$request->session()->flash('error', 'Sorry, but the requested file could not be found in storage. Sometimes, files may be physically deleted by admins, but not from the app\'s database.');
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user