I am using Laravel 5.5and trying to get used to the psr-2 standard code (just started learning). I analyze all my code with Quafoo QA and step by step fix bugs and write them down.
Using facades, I get this error "Avoid using static access to class". Because of this, I try to avoid using them.
On my controller, I have this code:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Events\FileLoaded;
use Illuminate\Support\Facades\Input;
use Illuminate\Auth\Middleware\Authenticate;
use PhpOffice\PhpSpreadsheet\Shared\StringHelper;
use \Illuminate\Contracts\View\Factory as ViewFactory;
class LoadDataController extends Controller
{
public function index()
{
$viewfactory = app(ViewFactory::class);
return $viewfactory->make('LoadData/index');
}
}
Besides View Facade, I also use DB, Input, Validator and Storage
Is it right, are there others?
source
share