vendredi 29 avril 2016

Some questions on laravel 5

I have some sort of beginner intermediate question about the laravel 5 framework.

  • When to use facade and when to use DI. To someone who is complete new to Laravel these two concept are a little hard to grasp. Here is an example.
<?php namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Routing\Controller;

class UserController extends Controller {
    public function store(Request $request)
    {
        $name = $request->input('name');
    }
}

vs using this

<?php namespace App\Http\Controllers;

use Request; // Facade of Illuminate\Http\Request
use Illuminate\Routing\Controller;

class UserController extends Controller {
    public function store()
    {
        $name = Request::input('name');
    }
}
  • If we wanted to create our own classes to use where can we put our own classes in the laravel default folder structure?

  • Is Illuminate being assembled by composer? How do we know which classes to use from the illuminate namespace?

  • If the project was hosted on a different server other than the default php server that comes with laravel, do we need to change the .htaccess?

  • -


from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1roaP11
via IFTTT

Aucun commentaire:

Enregistrer un commentaire