예제 #1
0
파일: routes.php 프로젝트: matc04/Laravel
use App\Usuario;
/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::get('/', function () {
    return view('welcome');
});
Route::get('prueba1', function () {
    $user = Usuario::first()->snombre;
    return view('curso.example', compact('user'));
});
Route::controllers(['prueba' => 'PruebaController']);
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/
Route::group(['middleware' => ['web'], 'prefix' => 'admin', 'namespace' => 'Admin'], function () {
    Route::resource('usuario', 'UsuarioController');
예제 #2
0
 public function getIndex()
 {
     $result = Usuario::first();
     dd($result);
 }