agriya/webshopauthenticate

本包最新版本(dev-master)没有可用的许可证信息。

dev-master 2014-05-07 14:10 UTC

This package is not auto-updated.

Last update: 2024-09-28 15:39:24 UTC


README

Laravel 4 基础认证包

安装

将以下内容添加到您的 composer.json 文件中

"agriya/webshopauthenticate": "dev-master"

运行

composer update

将以下内容添加到 app/config/app.php 中

'Agriya\Webshopauthenticate\WebshopauthenticateServiceProvider',

发布配置

php artisan config:publish agriya/webshopauthenticate

发布资源文件

php artisan asset:publish agriya/webshopauthenticate

运行迁移

php artisan migrate --package="agriya/webshopauthenticate"

运行数据库种子数据

php artisan db:seed --class="Agriya\Webshopauthenticate\UsersGroupsTableSeeder"

将以下内容添加到 app/routes.php 中

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');
});

在成员 & 管理布局中添加以下链接

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'))