Awesome Open Source
Awesome Open Source

urpm Laravel

UUser

RRole

PPermission

MMenu

Demo:Demo

Demo:admin :123456

star

****

    • controller
    • get/post
    • urlcontroller

  • Laravel 5.3+
  • php 5.6.4
  • composer

git clone https://github.com/jachohx/urpm.git

git clone https://git.oschina.net/jacho/urpm.git

//
composer install

APP_KEY

//
php artisan key:generate
php artisan config:clear

.env

//DB_
//APP_URL

//
//
php artisan migrate
//
composer dump-autoload
php artisan db:seed

APP_URL
http://108.61.186.199:8088/
admin
123456

laravelrestfulCotrollerstoreupdatestoreupdate_method=POSTControllerstorePUTControllerupdate

.post_method=POSTidid>0_method=PUT

class  _submit_class
data-form-id form ID
data-urlpostformURLformactionurlstorerestfulurlid
data-refresh-urlurl
//#form /menu/1_method=PUT/
<form id="form" action='/menu'>
<input type="hidden" name="id" value="1" />
<button type="submit" class="_submit_" data-form-id="form" data-refresh-url="/"></button>

laravelrestfulControllerdestroy_method=DELETEControllerdestroy

class  _delete_class
data-urlpostURLurlrestful
///menu/1_method=DELETE
<a href="#" class="_delete_" data-url="/menu/1"></a>

.env

//DB_
//APP_URL

//
//SQLfalse
DB_LOG=true
//ID
//ID
DB_USER_CANNOT_MANAGE_IDS=1
//ID
DB_ROLE_CANNOT_MANAGE_IDS=1
//ID
DB_PERMISSION_CANNOT_MANAGE_IDS=1,2,3,4,5,6,7,8,9,10
//ID
DB_MENU_CANNOT_MANAGE_IDS=1,2,3,4,5,6,7,8

app/Http/Kernel.php middleware

$routeMiddleware => [
    'permission'            => \App\Http\Middleware\AdminPermission::class,
]

config/app.php aliases

'aliases' => [
    'Admin' => App\Facedes\AdminFacedes::class,
]

routes/web.php route

//auth
Route::group(['prefix' => '/auth', 'namespace' => "Auth", 'middleware' => ['csrf']], function () {
    Route::get('login',                     '[email protected]')->name('login');
    Route::post('login',                    '[email protected]');
    Route::get('logout',                    '[email protected]')->name('logout');
    Route::post('logout',                   '[email protected]')->name('logout');
});

//
Route::group(['prefix' => '/', 'middleware' => ['auth', 'permission']], function () {
    Route::resource('/menu/tree',           '[email protected]');
    Route::resource('/menu',                'MenuController');
    Route::get('/role/{id}/permission',     '[email protected]');
    Route::post('/role/{id}/permission',    '[email protected]');
    Route::resource('/role',                'RoleController');
    Route::resource('/user',                'UserController');
    Route::resource('/permission',          'PermissionController');
    Route::resource('/info',                'InfoController');
    Route::resource('/log',                 'LogController');
    Route::resource('/loginLog',            'LoginLogController');

    Route::resource('/',                    'HomeController');
});

app/Providers/EventServiceProvider.php listen

//DB_LOG=truelistenSQL
protected $listen = [
    'Illuminate\Database\Events\QueryExecuted' => [
    	'App\Listeners\DatabaseEventListener'
    ]
];

nginx

server {
    listen       8088;
    server_name  demo.jachohx.com;
    location / {
        index index.php index.html;
        root /var/www/urpm/public/;
        try_files $uri $uri/ /index.php?$query_string;
    }
    location ~ \.php$ {
        root   /var/www/urpm/public/;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        fastcgi_intercept_errors on;
        include /etc/nginx/fastcgi.conf;
    }
    location ~* \.(css|js|jpg|woff|woff2|png)$ {
        root /var/www/urpm/resources/assets/;
        break;
    }
}

  • v1.0.0

star


Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Php (404,320
Laravel (13,169
Admin (1,521
Menu (831
Permissions (685
User (593
Role (588
Related Projects