2
<?php namespace App\Http\Controllers;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\ListaProduto;
use App\Produto;
use Input;
use Illuminate\Support\Facades\Request;
use Session;
class ProdutoController extends Controller {
# Página de Exibir Produtos
public function getAdicionar(){
return view('backend.produtos');
}
}
It was until recently developing sites and systems using the Laravel 4. And now I’m migrating to the Laravel 5.
I am realizing that some functions previously existing in 4 are no longer compiled in 5. An example:
The library Facade/HTML.
I’m having to install this library on every website I design on Laravel 5. Okay, that’s the least of it. Type in the file Composer.json and have it rotated.
But something happens to me that I don’t know if it’s normal, if it’s native to Laravel 5 or if it’s just a command I need to make so it doesn’t happen anymore. In the code I posted above see the first lines:
use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\ListaProduto;
use App\Produto;
use Input;
use Illuminate\Support\Facades\Request;
use Session;
Every time I use some function I need to declare. Before, in 4, with me, it was not like this. Even one Model need tell for the code I will use you. If I want to use the table Product, I have to describe use App\Produto;
and so on with Session
, with Cookies
, with Hash
.
Questions
1 - This is really necessary ?
2 - There is something I can do to reverse this ?
+1. This question is very important for those who are willing to migrate from Laravel 4 to 5
– Wallace Maxters