Hi, You can use this package to get back scaffold.
Authentication built in views are not found!
Hi, I am new to laravel, I downloaded the Laravel 5.1 framework.
I am watching while trying to follow the code the Easy Auth video https://laracasts.com/series/laravel-5-fundamentals/episodes/15.
in the video it shows some good looking views and Services code which will do the Authentication. However, my instance of Laravel did not come with the view that he is using neither the file located in the Services folder.
The documentation seems to show some function but the video seems to be talking about more than what the docs have http://laravel.com/docs/5.1/authentication
Is there a way for me to get a copy of the authentication views/files that are in the video?
@bestmomo what is scafford? it does not seems to have definition in the github
@malhayek my english is poor, scaffold is something as construction. In this context it's all you need for authentication.
Thank you @bestmomo I will install it now and give it a shot
@bestmomo I have a question, in the login.blade.php template you have this code {{ url('/password/email') }} which work if I home to dev.app/password/email However, what is confusing me here is how does it work even if I do not have a route for this? what is allowing this to work? I am trying to use named routes so I like to change {{ url('/password/email') }} to something like {{ path_to_route('reset_password_path') }}
@malhayek routes are in the package.
@bestmomo I do not see these routes in my route.php file.
here is what my route.php file has
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for 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.
|
*/
/*
|--------------------------------------------------------------------------
| Classes to use
|--------------------------------------------------------------------------
*/
use App\Models\Account;
/*
|--------------------------------------------------------------------------
| Generic Routes
|--------------------------------------------------------------------------
*/
Route::get('/', function () {
return view('welcome');
});
Route::get('home', array('as' => 'home_path'), function () {
$user = Auth::user();
return view('logged', compact('user') );
});
/*
|--------------------------------------------------------------------------
| Account Object Routes
|--------------------------------------------------------------------------
*/
Route::bind('account', function($id){
return Account::where('account_id', $id)->first();
});
/*
Route::model('account', function($id){
return Account::find($id);
});
*/
Route::get('accounts', array('as' => 'accounts_index_path', 'uses' => 'AccountController@index') );
Route::get('account/create', array('as' => 'account_create_path', 'uses' => 'AccountController@create') );
Route::post('account/store', array('as' => 'account_store_path', 'uses' => 'AccountController@store') );
Route::get('account/{account}', array('as' => 'account_show_path', 'uses' => 'AccountController@show') )->where('account', '[0-9]+');
Route::get('account/{account}/edit', array('as' => 'account_edit_path', 'uses' => 'AccountController@edit') )->where('account', '[0-9]+');
Route::put('account/{account}/update', array('as' => 'account_update_path', 'uses' => 'AccountController@update') )->where('account', '[0-9]+');
/*
|--------------------------------------------------------------------------
| Authentication Routes
|--------------------------------------------------------------------------
*/
// login routes
Route::get('auth/login', array('as' => 'login_path', 'uses' => 'Auth\AuthController@getLogin'));
Route::post('auth/login', array('as' => 'login_submit_path', 'uses' => 'Auth\AuthController@postLogin'));
Route::get('auth/logout', array('as' => 'logout_path', 'uses' => 'Auth\AuthController@getLogout'));
// Registration routes...
Route::get('auth/register', array('as' => 'register_path', 'uses' => 'Auth\AuthController@getRegister'));
Route::post('auth/register', array('as' => 'register_submit_path', 'uses' => 'Auth\AuthController@postRegister'));
When you install the package there are routes inside it that you dont see in your route file. The package as its own route file. Laravel knows there are these routes because there is also a service provider in the package that set these routes with this code :
// Routes
$this->app->router->group(['namespace' => $nameSpace . 'Http\Controllers'], function()
{
require __DIR__.'/Http/routes.php';
});
As you install the package you dont need these routes in your route file :
// login routes
Route::get('auth/login', array('as' => 'login_path', 'uses' => 'Auth\AuthController@getLogin'));
Route::post('auth/login', array('as' => 'login_submit_path', 'uses' => 'Auth\AuthController@postLogin'));
Route::get('auth/logout', array('as' => 'logout_path', 'uses' => 'Auth\AuthController@getLogout'));
// Registration routes...
Route::get('auth/register', array('as' => 'register_path', 'uses' => 'Auth\AuthController@getRegister'));
Route::post('auth/register', array('as' => 'register_submit_path', 'uses' => 'Auth\AuthController@postRegister'));
Because there are already defined in the package, but without the names.
Hum, I am confused. so how can I override this? I would like to have names to my routes.
Additionally, in the video https://laracasts.com/series/laravel-5-fundamentals/episodes/15 the author said Route:controllers is not the recommended approach for doing such a thing.
A simple way :
- install the package,
- publish the views,
- uninstall the package,
- delete provider reference in config/app.php So you keep only the views and your routes will be ok.
Please or to participate in this conversation.