<?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');
}
}
I was recently developing websites and systems using Laravel 4 . And now I'm migrating to Laravel 5 .
I'm noticing that some functions that existed before in 4, are no longer compiled in 5. An example:
The Facade / HTML library.
I'm having to install this library on every site that I create the project on Laravel 5 . Beauty, that's the least. Type in the composer.json file and run it.
However, something happens to me that I do not know if it's normal, if it's native to Laravel 5 or if it's just a command I need to do so it does not happen anymore. In the code I posted above see the first few 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'm going to use some function I need to declare. Before, in 4, with me, it was not like that. Even a Model I need to tell the code I'm going to use. If I want to use the Product table, I have to describe use App\Produto;
and so on with Session
, with Cookies
, with Hash
.
Questions
1 - Is this really necessary? Home
2 - Is there anything I can do to reverse this?