07/05
2014
dev-master
9999999-dev
The Requires
- php >=5.3.0
- illuminate/support 4.1.*
- cartalyst/sentry 2.1.*
by Ahsan
Wallogit.com
2017 © Pedro Peláez
A Laravel 4 package for basic authentication, (*1)
Add the following to you composer.json file, (*2)
"agriya/webshopauthenticate": "dev-master"
Run, (*3)
composer update
Add the following to app/config/app.php, (*4)
'Agriya\Webshopauthenticate\WebshopauthenticateServiceProvider',
Publish the config, (*5)
php artisan config:publish agriya/webshopauthenticate
Publish the asset, (*6)
php artisan asset:publish agriya/webshopauthenticate
Run the migration, (*7)
php artisan migrate --package="agriya/webshopauthenticate"
Run the db seed, (*8)
php artisan db:seed --class="Agriya\Webshopauthenticate\UsersGroupsTableSeeder"
Add the following to app/routes.php, (*9)
Route::get(\Config::get('webshopauthenticate::uri').'/activation/{activationCode}', 'Agriya\Webshopauthenticate\AuthController@getActivate');
Route::group(array('before' => 'sentry.member'), function()
{
Route::get(\Config::get('webshopauthenticate::uri').'/myaccount', 'Agriya\Webshopauthenticate\AccountController@getIndex');
Route::post(\Config::get('webshopauthenticate::uri').'/myaccount', 'Agriya\Webshopauthenticate\AccountController@postIndex');
});
Route::get(\Config::get('webshopauthenticate::uri').'/{user_code_seo_title}', 'Agriya\Webshopauthenticate\ProfileController@viewProfile')->where('user_code_seo_title', 'U[0-9]{6}'); //Call when parameter has user code format value
Route::controller(\Config::get('webshopauthenticate::uri'), 'Agriya\Webshopauthenticate\AuthController');
Route::group(array('before' => 'sentry.admin'), function()
{
Route::get(Config::get('webshopauthenticate::admin_uri'), 'Agriya\Webshopauthenticate\AdminUserController@index');
Route::get(Config::get('webshopauthenticate::admin_uri').'/users/add', 'Agriya\Webshopauthenticate\AdminUserController@getAddUsers');
Route::post(Config::get('webshopauthenticate::admin_uri').'/users/add', 'Agriya\Webshopauthenticate\AdminUserController@postAddUsers');
Route::get(Config::get('webshopauthenticate::admin_uri').'/users/edit/{user_id}', 'Agriya\Webshopauthenticate\AdminUserController@getEditUsers');
Route::post(Config::get('webshopauthenticate::admin_uri').'/users/edit/{user_id}', 'Agriya\Webshopauthenticate\AdminUserController@postEditUsers');
Route::any(Config::get('webshopauthenticate::admin_uri').'/users/changestatus', 'Agriya\Webshopauthenticate\AdminUserController@getChangeUserStatus');
});
Add the following links in member & admin layouts, (*10)
Signup - URL::to(Config::get('webshopauthenticate::uri').'/signup')
Login - URL::to(Config::get('webshopauthenticate::uri').'/login')
Forgot password - URL::to(\Config::get('webshopauthenticate::uri').'/forgotpassword')
if (Sentry::check()) use below links
Edit profile - URL::to(Config::get('webshopauthenticate::uri').'/myaccount')
if (Sentry::check() && hasAdminAccess) use below links
Manage Member - URL::to(Config::get('webshopauthenticate::admin_uri'))