├── .babelrc ├── .env.example ├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md ├── app ├── Api │ └── V1 │ │ └── Controllers │ │ ├── AuthController.php │ │ ├── PermissionController.php │ │ ├── PermissionGroupController.php │ │ ├── RoleController.php │ │ └── UserController.php ├── Console │ └── Kernel.php ├── Exceptions │ ├── Access │ │ └── User │ │ │ └── UserNeedsRolesException.php │ ├── GeneralException.php │ └── Handler.php ├── Http │ ├── Controllers │ │ ├── Auth │ │ │ ├── ForgotPasswordController.php │ │ │ ├── LoginController.php │ │ │ ├── RegisterController.php │ │ │ └── ResetPasswordController.php │ │ ├── Controller.php │ │ ├── HomeController.php │ │ └── UserController.php │ ├── Kernel.php │ └── Middleware │ │ ├── EncryptCookies.php │ │ ├── RedirectIfAuthenticated.php │ │ └── VerifyCsrfToken.php ├── Models │ ├── Access │ │ ├── Permission │ │ │ ├── Permission.php │ │ │ ├── PermissionDependency.php │ │ │ └── PermissionGroup.php │ │ ├── Role │ │ │ └── Role.php │ │ └── User │ │ │ ├── User.php │ │ │ └── UserProvider.php │ └── BaseModel.php ├── Providers │ ├── AppServiceProvider.php │ ├── AuthServiceProvider.php │ ├── BroadcastServiceProvider.php │ ├── EventServiceProvider.php │ └── RouteServiceProvider.php ├── Repositories │ ├── Authentication │ │ ├── AuthenticationContract.php │ │ └── EloquentAuthenticationRepository.php │ ├── Music │ │ ├── EloquentMusicRepository.php │ │ └── MusicRepositoryContract.php │ ├── Permission │ │ ├── Dependency │ │ │ ├── EloquentPermissionDependencyRepository.php │ │ │ └── PermissionDependencyRepositoryContract.php │ │ ├── EloquentPermissionRepository.php │ │ ├── Group │ │ │ ├── EloquentPermissionGroupRepository.php │ │ │ └── PermissionGroupRepositoryContract.php │ │ └── PermissionRepositoryContract.php │ ├── Role │ │ ├── EloquentRoleRepository.php │ │ └── RoleRepositoryContract.php │ └── User │ │ ├── EloquentUserRepository.php │ │ └── UserContract.php └── Transformers │ ├── PermissionGroupTransformer.php │ ├── PermissionTransformer.php │ ├── RoleTransformer.php │ └── UserTransformer.php ├── artisan ├── bootstrap ├── app.php ├── autoload.php └── cache │ └── .gitignore ├── composer.json ├── composer.lock ├── config ├── access.php ├── api.php ├── app.php ├── auth.php ├── boilerplate.php ├── broadcasting.php ├── cache.php ├── compile.php ├── database.php ├── filesystems.php ├── jwt.php ├── mail.php ├── queue.php ├── services.php ├── session.php └── view.php ├── database ├── .gitignore ├── factories │ └── ModelFactory.php ├── migrations │ ├── .gitkeep │ ├── 2014_10_12_000000_create_users_table.php │ ├── 2014_10_12_100000_create_password_resets_table.php │ ├── 2015_04_27_022849_create_user_providers_table.php │ └── 2015_04_30_170442_setup_access_tables.php └── seeds │ ├── .gitkeep │ ├── Access │ ├── PermissionDependencyTableSeeder.php │ ├── PermissionGroupTableSeeder.php │ ├── PermissionTableSeeder.php │ ├── RoleTableSeeder.php │ ├── UserRoleSeeder.php │ └── UserTableSeeder.php │ ├── AccessTableSeeder.php │ └── DatabaseSeeder.php ├── gulpfile.js ├── package.json ├── phpunit.xml ├── public ├── .htaccess ├── css │ ├── app.css │ └── app.css.map ├── favicon.ico ├── fonts │ └── bootstrap │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 ├── index.php ├── js │ ├── app.js │ └── app.js.map └── robots.txt ├── readme.md ├── resources ├── assets │ ├── bootstrap-less │ │ ├── mixins.less │ │ ├── mixins │ │ │ ├── alerts.less │ │ │ ├── background-variant.less │ │ │ ├── border-radius.less │ │ │ ├── buttons.less │ │ │ ├── center-block.less │ │ │ ├── clearfix.less │ │ │ ├── forms.less │ │ │ ├── gradients.less │ │ │ ├── grid-framework.less │ │ │ ├── grid.less │ │ │ ├── hide-text.less │ │ │ ├── image.less │ │ │ ├── labels.less │ │ │ ├── list-group.less │ │ │ ├── nav-divider.less │ │ │ ├── nav-vertical-align.less │ │ │ ├── opacity.less │ │ │ ├── pagination.less │ │ │ ├── panels.less │ │ │ ├── progress-bar.less │ │ │ ├── reset-filter.less │ │ │ ├── reset-text.less │ │ │ ├── resize.less │ │ │ ├── responsive-visibility.less │ │ │ ├── size.less │ │ │ ├── tab-focus.less │ │ │ ├── table-row.less │ │ │ ├── text-emphasis.less │ │ │ ├── text-overflow.less │ │ │ └── vendor-prefixes.less │ │ └── variables.less │ ├── js │ │ ├── app.js │ │ ├── auth.js │ │ ├── bootstrap.js │ │ └── components │ │ │ ├── About.vue │ │ │ ├── App.vue │ │ │ ├── AppFooter.vue │ │ │ ├── AppHeader.vue │ │ │ ├── AppSidebar.vue │ │ │ ├── Auth │ │ │ ├── ForgotPassword.vue │ │ │ ├── Login.vue │ │ │ └── Register.vue │ │ │ ├── Container.vue │ │ │ ├── Dashboard.vue │ │ │ ├── Example.vue │ │ │ ├── Grid.vue │ │ │ ├── Users.vue │ │ │ ├── Util │ │ │ ├── Tab.vue │ │ │ └── Tabs.vue │ │ │ └── passport │ │ │ ├── AuthorizedClients.vue │ │ │ ├── Clients.vue │ │ │ ├── Index.vue │ │ │ └── PersonalAccessTokens.vue │ ├── less │ │ ├── .csslintrc │ │ ├── 404_500_errors.less │ │ ├── alerts.less │ │ ├── app.less │ │ ├── bootstrap-social.less │ │ ├── boxes.less │ │ ├── buttons.less │ │ ├── callout.less │ │ ├── carousel.less │ │ ├── control-sidebar.less │ │ ├── core.less │ │ ├── direct-chat.less │ │ ├── dropdown.less │ │ ├── forms.less │ │ ├── fullcalendar.less │ │ ├── header.less │ │ ├── info-box.less │ │ ├── invoice.less │ │ ├── labels.less │ │ ├── lockscreen.less │ │ ├── login_and_register.less │ │ ├── mailbox.less │ │ ├── miscellaneous.less │ │ ├── mixins.less │ │ ├── modal.less │ │ ├── navs.less │ │ ├── print.less │ │ ├── products.less │ │ ├── profile.less │ │ ├── progress-bars.less │ │ ├── select2.less │ │ ├── sidebar-mini.less │ │ ├── sidebar.less │ │ ├── skins │ │ │ ├── _all-skins.less │ │ │ ├── skin-black-light.less │ │ │ ├── skin-black.less │ │ │ ├── skin-blue-light.less │ │ │ ├── skin-blue.less │ │ │ ├── skin-green-light.less │ │ │ ├── skin-green.less │ │ │ ├── skin-purple-light.less │ │ │ ├── skin-purple.less │ │ │ ├── skin-red-light.less │ │ │ ├── skin-red.less │ │ │ ├── skin-yellow-light.less │ │ │ └── skin-yellow.less │ │ ├── small-box.less │ │ ├── social-widgets.less │ │ ├── table.less │ │ ├── timeline.less │ │ ├── users-list.less │ │ └── variables.less │ └── sass │ │ ├── app.scss │ │ ├── sidebar.scss │ │ └── variables.scss ├── lang │ └── en │ │ ├── auth.php │ │ ├── pagination.php │ │ ├── passwords.php │ │ └── validation.php └── views │ ├── admin │ ├── index.blade.php │ └── layouts │ │ └── app.blade.php │ ├── auth │ ├── login.blade.php │ ├── passwords │ │ ├── email.blade.php │ │ └── reset.blade.php │ └── register.blade.php │ ├── errors │ └── 503.blade.php │ ├── home.blade.php │ ├── layouts │ └── app.blade.php │ ├── vendor │ └── .gitkeep │ └── welcome.blade.php ├── routes ├── api.php ├── console.php └── web.php ├── server.php ├── storage ├── app │ ├── .gitignore │ └── public │ │ └── .gitignore ├── framework │ ├── .gitignore │ ├── cache │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ └── views │ │ └── .gitignore ├── logs │ └── .gitignore ├── oauth-private.key └── oauth-public.key ├── tests ├── ExampleTest.php └── TestCase.php ├── webpack.config.js └── webpack.config.js.bkp /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015"], 3 | "plugins": ["transform-vue-jsx"] 4 | } -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | APP_ENV=local 2 | APP_KEY= 3 | APP_DEBUG=true 4 | APP_LOG_LEVEL=debug 5 | APP_URL=http://localhost 6 | 7 | API_PREFIX=api 8 | API_DEBUG=true 9 | API_STANDARDS_TREE=vnd 10 | API_SUBTYPE=myapp 11 | API_DOMAIN=api.myapp.com 12 | API_VERSION=v1 13 | API_NAME="My API" 14 | API_CONDITIONAL_REQUEST=false 15 | API_STRICT=false 16 | API_DEFAULT_FORMAT=json 17 | 18 | DB_CONNECTION=mysql 19 | DB_HOST=127.0.0.1 20 | DB_PORT=3306 21 | DB_DATABASE=homestead 22 | DB_USERNAME=homestead 23 | DB_PASSWORD=secret 24 | 25 | BROADCAST_DRIVER=log 26 | CACHE_DRIVER=file 27 | SESSION_DRIVER=file 28 | QUEUE_DRIVER=sync 29 | 30 | REDIS_HOST=127.0.0.1 31 | REDIS_PASSWORD=null 32 | REDIS_PORT=6379 33 | 34 | MAIL_DRIVER=smtp 35 | MAIL_HOST=mailtrap.io 36 | MAIL_PORT=2525 37 | MAIL_USERNAME=null 38 | MAIL_PASSWORD=null 39 | MAIL_ENCRYPTION=null 40 | 41 | PUSHER_KEY= 42 | PUSHER_SECRET= 43 | PUSHER_APP_ID= 44 | 45 | 46 | GITHUB_CLIENT_ID= 47 | GITHUB_CLIENT_SECRET= 48 | GITHUB_REDIRECT= 49 | 50 | FACEBOOK_CLIENT_ID=1751247545104807 51 | FACEBOOK_CLIENT_SECRET=bd80912daeb991bcd6f40a00a97dacee 52 | FACEBOOK_REDIRECT=auth/login/facebook 53 | 54 | TWITTER_CLIENT_ID= 55 | TWITTER_CLIENT_SECRET= 56 | TWITTER_REDIRECT= 57 | 58 | GOOGLE_CLIENT_ID=462261954816-e1as91i241gr20d707pevsv41b6lk2es.apps.googleusercontent.com 59 | GOOGLE_CLIENT_SECRET=zKh83ac5_ZjIM_sJx-I_cHh4 60 | GOOGLE_REDIRECT=auth/login/google 61 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.css linguist-vendored 3 | *.scss linguist-vendored 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /public/storage 3 | /vendor 4 | /.idea 5 | Homestead.json 6 | Homestead.yaml 7 | .env 8 | composer.lock 9 | yarn.lock 10 | public/js/* 11 | public/css/ -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 suresh 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # laravel-5.3-boilerplate-api-jwt-angular 2 | Laravel 5.3 application for building the applications with quick 3 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire') 29 | // ->hourly(); 30 | } 31 | 32 | /** 33 | * Register the Closure based commands for the application. 34 | * 35 | * @return void 36 | */ 37 | protected function commands() 38 | { 39 | require base_path('routes/console.php'); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/Exceptions/Access/User/UserNeedsRolesException.php: -------------------------------------------------------------------------------- 1 | user_id = $user_id; 25 | } 26 | 27 | /** 28 | * @return mixed 29 | */ 30 | public function userID() 31 | { 32 | return $this->user_id; 33 | } 34 | 35 | /** 36 | * @param $errors 37 | */ 38 | public function setValidationErrors($errors) 39 | { 40 | $this->errors = $errors; 41 | } 42 | 43 | /** 44 | * @return mixed 45 | */ 46 | public function validationErrors() 47 | { 48 | return $this->errors; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/Exceptions/GeneralException.php: -------------------------------------------------------------------------------- 1 | expectsJson()) { 63 | return response()->json(['error' => 'Unauthenticated.'], 401); 64 | } 65 | 66 | return redirect()->guest('login'); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ForgotPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/LoginController.php: -------------------------------------------------------------------------------- 1 | middleware('guest', ['except' => 'logout']); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/RegisterController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 40 | } 41 | 42 | /** 43 | * Get a validator for an incoming registration request. 44 | * 45 | * @param array $data 46 | * 47 | * @return \Illuminate\Contracts\Validation\Validator 48 | */ 49 | protected function validator(array $data) 50 | { 51 | return Validator::make($data, [ 52 | 'name' => 'required|max:255', 53 | 'email' => 'required|email|max:255|unique:users', 54 | 'password' => 'required|min:6|confirmed', 55 | ]); 56 | } 57 | 58 | /** 59 | * Create a new user instance after a valid registration. 60 | * 61 | * @param array $data 62 | * 63 | * @return User 64 | */ 65 | protected function create(array $data) 66 | { 67 | return User::create([ 68 | 'name' => $data['name'], 69 | 'email' => $data['email'], 70 | 'password' => bcrypt($data['password']), 71 | ]); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ResetPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | fails()) { 21 | throw new ValidationHttpException($validator->errors()->all()); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/Http/Controllers/HomeController.php: -------------------------------------------------------------------------------- 1 | [ 27 | \App\Http\Middleware\EncryptCookies::class, 28 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, 29 | \Illuminate\Session\Middleware\StartSession::class, 30 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 31 | \App\Http\Middleware\VerifyCsrfToken::class, 32 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 33 | ], 34 | 35 | 'api' => [ 36 | 'throttle:60,1', 37 | 'bindings', 38 | ], 39 | ]; 40 | 41 | /** 42 | * The application's route middleware. 43 | * 44 | * These middleware may be assigned to groups or used individually. 45 | * 46 | * @var array 47 | */ 48 | protected $routeMiddleware = [ 49 | 'auth' => \Illuminate\Auth\Middleware\Authenticate::class, 50 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 51 | 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, 52 | 'can' => \Illuminate\Auth\Middleware\Authorize::class, 53 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 54 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 55 | ]; 56 | } 57 | -------------------------------------------------------------------------------- /app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | check()) { 22 | return redirect('/home'); 23 | } 24 | 25 | return $next($request); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/Http/Middleware/VerifyCsrfToken.php: -------------------------------------------------------------------------------- 1 | 'integer', 27 | 'group_id' => 'integer', 28 | 'system' => 'boolean', 29 | 'sort' => 'integer', 30 | 'id' => 'integer', 31 | 32 | ]; 33 | 34 | public function __construct() 35 | { 36 | $this->table = config('access.permissions_table'); 37 | } 38 | 39 | /** 40 | * @return mixed 41 | */ 42 | public function roles() 43 | { 44 | return $this->belongsToMany(config('access.role'), config('access.permission_role_table'), 'permission_id', 45 | 'role_id'); 46 | } 47 | 48 | /** 49 | * @return mixed 50 | */ 51 | public function group() 52 | { 53 | return $this->belongsTo(PermissionGroup::class, 'group_id'); 54 | } 55 | 56 | /** 57 | * @return mixed 58 | */ 59 | public function users() 60 | { 61 | return $this->belongsToMany(config('auth.model'), config('access.permission_user_table'), 'permission_id', 62 | 'user_id'); 63 | } 64 | 65 | /** 66 | * @return mixed 67 | */ 68 | public function dependencies() 69 | { 70 | return $this->hasMany(PermissionDependency::class, 'permission_id', 'id'); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /app/Models/Access/Permission/PermissionDependency.php: -------------------------------------------------------------------------------- 1 | 'integer', 27 | 'dependency_id' => 'integer', 28 | 'id' => 'integer', 29 | ]; 30 | 31 | public function __construct() 32 | { 33 | $this->table = config('access.permission_dependencies_table'); 34 | } 35 | 36 | /** 37 | * @return mixed 38 | */ 39 | public function permission() 40 | { 41 | return $this->hasOne(Permission::class, 'id', 'dependency_id'); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/Models/Access/Permission/PermissionGroup.php: -------------------------------------------------------------------------------- 1 | table = config('access.permission_group_table'); 31 | } 32 | 33 | /** 34 | * @return mixed 35 | */ 36 | public function children() 37 | { 38 | return $this->hasMany(self::class, 'parent_id', 'id')->orderBy('sort', 'asc'); 39 | } 40 | 41 | /** 42 | * @return mixed 43 | */ 44 | public function permissions() 45 | { 46 | return $this->hasMany(Permission::class, 'group_id')->orderBy('sort', 'asc'); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /app/Models/Access/User/UserProvider.php: -------------------------------------------------------------------------------- 1 | app->bind( 27 | \App\Repositories\Authentication\AuthenticationContract::class, 28 | \App\Repositories\Authentication\EloquentAuthenticationRepository::class 29 | ); 30 | 31 | $this->app->bind( 32 | \App\Repositories\User\UserContract::class, 33 | \App\Repositories\User\EloquentUserRepository::class 34 | ); 35 | 36 | $this->app->bind( 37 | \App\Repositories\Role\RoleRepositoryContract::class, 38 | \App\Repositories\Role\EloquentRoleRepository::class 39 | ); 40 | 41 | $this->app->bind( 42 | \App\Repositories\Permission\PermissionRepositoryContract::class, 43 | \App\Repositories\Permission\EloquentPermissionRepository::class 44 | ); 45 | 46 | $this->app->bind( 47 | \App\Repositories\Permission\Group\PermissionGroupRepositoryContract::class, 48 | \App\Repositories\Permission\Group\EloquentPermissionGroupRepository::class 49 | ); 50 | 51 | $this->app->bind( 52 | \App\Repositories\Permission\Dependency\PermissionDependencyRepositoryContract::class, 53 | \App\Repositories\Permission\Dependency\EloquentPermissionDependencyRepository::class 54 | ); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /app/Providers/AuthServiceProvider.php: -------------------------------------------------------------------------------- 1 | 'App\Policies\ModelPolicy', 17 | ]; 18 | 19 | /** 20 | * Register any authentication / authorization services. 21 | * 22 | * @return void 23 | */ 24 | public function boot() 25 | { 26 | $this->registerPolicies(); 27 | Passport::routes(); 28 | // 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | id === (int) $userId; 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Providers/EventServiceProvider.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'App\Listeners\EventListener', 18 | ], 19 | ]; 20 | 21 | /** 22 | * Register any events for your application. 23 | * 24 | * @return void 25 | */ 26 | public function boot() 27 | { 28 | parent::boot(); 29 | 30 | // 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | mapWebRoutes(); 39 | 40 | $this->mapApiRoutes(); 41 | 42 | // 43 | } 44 | 45 | /** 46 | * Define the "web" routes for the application. 47 | * 48 | * These routes all receive session state, CSRF protection, etc. 49 | * 50 | * @return void 51 | */ 52 | protected function mapWebRoutes() 53 | { 54 | Route::group([ 55 | 'middleware' => 'web', 56 | 'namespace' => $this->namespace, 57 | ], function ($router) { 58 | require base_path('routes/web.php'); 59 | }); 60 | } 61 | 62 | /** 63 | * Define the "api" routes for the application. 64 | * 65 | * These routes are typically stateless. 66 | * 67 | * @return void 68 | */ 69 | protected function mapApiRoutes() 70 | { 71 | Route::group([ 72 | 'middleware' => 'api', 73 | 'namespace' => $this->namespace, 74 | 'prefix' => 'api', 75 | ], function ($router) { 76 | require base_path('routes/api.php'); 77 | }); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /app/Repositories/Authentication/AuthenticationContract.php: -------------------------------------------------------------------------------- 1 | permission_id = $permission_id; 22 | $dependency->dependency_id = $dependency_id; 23 | 24 | return $dependency->save(); 25 | } 26 | 27 | /** 28 | * @param $permission_id 29 | * 30 | * @return mixed 31 | */ 32 | public function clear($permission_id) 33 | { 34 | return PermissionDependency::where('permission_id', $permission_id) 35 | ->delete(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/Repositories/Permission/Dependency/PermissionDependencyRepositoryContract.php: -------------------------------------------------------------------------------- 1 | (int) $role->id, 19 | 'name' => $role->name, 20 | ]; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/Transformers/PermissionTransformer.php: -------------------------------------------------------------------------------- 1 | (int) $role->id, 19 | 'name' => $role->name, 20 | ]; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/Transformers/RoleTransformer.php: -------------------------------------------------------------------------------- 1 | (int) $role->id, 19 | 'name' => $role->name, 20 | ]; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/Transformers/UserTransformer.php: -------------------------------------------------------------------------------- 1 | (int) $user->id, 28 | 'name' => $user->name, 29 | 'email' => $user->email, 30 | ]; 31 | } 32 | 33 | /** 34 | * Include Author. 35 | * 36 | * @return League\Fractal\ItemResource 37 | */ 38 | public function includeRoles(User $user) 39 | { 40 | $roles = $user->roles; 41 | 42 | return $this->collection($roles, new RoleTransformer(), ['data' => 'id']); 43 | } 44 | 45 | /** 46 | * Include Permissions. 47 | * 48 | * @return League\Fractal\ItemResource 49 | */ 50 | public function includePermissions(User $user) 51 | { 52 | $permissions = $user->permissions; 53 | 54 | return $this->collection($permissions, new PermissionTransformer()); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | make(Illuminate\Contracts\Console\Kernel::class); 32 | 33 | $status = $kernel->handle( 34 | $input = new Symfony\Component\Console\Input\ArgvInput, 35 | new Symfony\Component\Console\Output\ConsoleOutput 36 | ); 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Shutdown The Application 41 | |-------------------------------------------------------------------------- 42 | | 43 | | Once Artisan has finished running. We will fire off the shutdown events 44 | | so that any final work may be done by the application before we shut 45 | | down the process. This is the last thing to happen to the request. 46 | | 47 | */ 48 | 49 | $kernel->terminate($input, $status); 50 | 51 | exit($status); 52 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | Illuminate\Contracts\Http\Kernel::class, 31 | App\Http\Kernel::class 32 | ); 33 | 34 | $app->singleton( 35 | Illuminate\Contracts\Console\Kernel::class, 36 | App\Console\Kernel::class 37 | ); 38 | 39 | $app->singleton( 40 | Illuminate\Contracts\Debug\ExceptionHandler::class, 41 | App\Exceptions\Handler::class 42 | ); 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Return The Application 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This script returns the application instance. The instance is given to 50 | | the calling script so we can separate the building of the instances 51 | | from the actual running of the application and sending responses. 52 | | 53 | */ 54 | 55 | return $app; 56 | -------------------------------------------------------------------------------- /bootstrap/autoload.php: -------------------------------------------------------------------------------- 1 | =5.6.4", 12 | "laravel/framework": "5.3.*", 13 | "tymon/jwt-auth": "0.5.*", 14 | "dingo/api": "1.0.*@dev", 15 | "league/fractal": "^0.14.0", 16 | "laravel/socialite": "^2.0", 17 | "doctrine/dbal": "^2.5", 18 | "optimus/bruno": "^2.0", 19 | "nicolaslopezj/searchable": "^1.9", 20 | "laravel/passport": "^1.0" 21 | }, 22 | "require-dev": { 23 | "fzaninotto/faker": "~1.4", 24 | "mockery/mockery": "0.9.*", 25 | "phpunit/phpunit": "~5.0", 26 | "symfony/css-selector": "3.1.*", 27 | "symfony/dom-crawler": "3.1.*" 28 | }, 29 | "autoload": { 30 | "classmap": [ 31 | "database" 32 | ], 33 | "psr-4": { 34 | "App\\": "app/" 35 | } 36 | }, 37 | "autoload-dev": { 38 | "classmap": [ 39 | "tests/TestCase.php" 40 | ] 41 | }, 42 | "scripts": { 43 | "post-root-package-install": [ 44 | "php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 45 | ], 46 | "post-create-project-cmd": [ 47 | "php artisan key:generate" 48 | ], 49 | "post-install-cmd": [ 50 | "Illuminate\\Foundation\\ComposerScripts::postInstall", 51 | "php artisan optimize" 52 | ], 53 | "post-update-cmd": [ 54 | "Illuminate\\Foundation\\ComposerScripts::postUpdate", 55 | "php artisan optimize" 56 | ] 57 | }, 58 | "config": { 59 | "preferred-install": "dist" 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /config/access.php: -------------------------------------------------------------------------------- 1 | App\Models\Access\Role\Role::class, 9 | 10 | /* 11 | * Roles table used by Access to save roles to the database. 12 | */ 13 | 'roles_table' => 'roles', 14 | 15 | /* 16 | * Permission model used by Access to create correct relations. 17 | * Update the permission if it is in a different namespace. 18 | */ 19 | 'permission' => 'App\Models\Access\Permission\Permission', 20 | 21 | /* 22 | * Permissions table used by Access to save permissions to the database. 23 | */ 24 | 'permissions_table' => 'permissions', 25 | 26 | /* 27 | * PermissionGroup model used by Access to create permissions groups. 28 | * Update the group if it is in a different namespace. 29 | */ 30 | 'group' => 'App\Models\Access\Permission\PermissionGroup', 31 | 32 | /* 33 | * Permissions table used by Access to save permissions to the database. 34 | */ 35 | 'permission_group_table' => 'permission_groups', 36 | 37 | /* 38 | * permission_role table used by Access to save relationship between permissions and roles to the database. 39 | */ 40 | 'permission_role_table' => 'permission_role', 41 | 42 | /* 43 | * permission_user table used by Access to save relationship between permissions and users to the database. 44 | * This table is only for permissions that belong directly to a specific user and not a role 45 | */ 46 | 'permission_user_table' => 'permission_user', 47 | 48 | /* 49 | * Table that specifies if one permission is dependent on another. 50 | * For example in order for a user to have the edit-user permission they also need the view-backend permission. 51 | */ 52 | 'permission_dependencies_table' => 'permission_dependencies', 53 | 54 | /* 55 | * assigned_roles table used by Access to save assigned roles to the database. 56 | */ 57 | 'assigned_roles_table' => 'assigned_roles', 58 | 59 | /* 60 | * Configurations for the user 61 | */ 62 | 'users' => [ 63 | /* 64 | * Administration tables 65 | */ 66 | 'default_per_page' => 25, 67 | 68 | /* 69 | * The role the user is assigned to when they sign up from the frontend, not namespaced 70 | */ 71 | 'default_role' => 'User', 72 | //'default_role' => 2, 73 | 74 | /* 75 | * Whether or not the user has to confirm their email when signing up 76 | */ 77 | 'confirm_email' => false, 78 | 79 | /* 80 | * Whether or not the users email can be changed on the edit profile screen 81 | */ 82 | 'change_email' => false, 83 | ], 84 | 85 | /* 86 | * Configuration for roles 87 | */ 88 | 'roles' => [ 89 | /* 90 | * Whether a role must contain a permission or can be used standalone as a label 91 | */ 92 | 'role_must_contain_permission' => true, 93 | ], 94 | ]; 95 | -------------------------------------------------------------------------------- /config/boilerplate.php: -------------------------------------------------------------------------------- 1 | [ 16 | 'name', 'email', 'password', 17 | ], 18 | 19 | /* 20 | |-------------------------------------------------------------------------- 21 | | Signup Fields Rules 22 | |-------------------------------------------------------------------------- 23 | | 24 | | Here you can put the rules you want to use for the validator instance 25 | | in the signup method. 26 | | 27 | */ 28 | 'signup_fields_rules' => [ 29 | 'name' => 'required', 30 | 'email' => 'required|email|unique:users', 31 | 'password' => 'required|min:6', 32 | ], 33 | 34 | /* 35 | |-------------------------------------------------------------------------- 36 | | Signup Token Release 37 | |-------------------------------------------------------------------------- 38 | | 39 | | If this field is "true", an authentication token will be automatically 40 | | released after signup. Otherwise, the signup method will return a simple 41 | | success message. 42 | | 43 | */ 44 | 'signup_token_release' => env('API_SIGNUP_TOKEN_RELEASE', true), 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Password Reset Token Release 49 | |-------------------------------------------------------------------------- 50 | | 51 | | If this field is "true", an authentication token will be automatically 52 | | released after password reset. Otherwise, the signup method will return a 53 | | simple success message. 54 | | 55 | */ 56 | 'reset_token_release' => env('API_RESET_TOKEN_RELEASE', true), 57 | 58 | /* 59 | |-------------------------------------------------------------------------- 60 | | Recovery Email Subject 61 | |-------------------------------------------------------------------------- 62 | | 63 | | The email address you want use to send the recovery email. 64 | | 65 | */ 66 | 'recovery_email_subject' => env('API_RECOVERY_EMAIL_SUBJECT', true), 67 | 68 | ]; 69 | -------------------------------------------------------------------------------- /config/broadcasting.php: -------------------------------------------------------------------------------- 1 | env('BROADCAST_DRIVER', 'null'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Broadcast Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the broadcast connections that will be used 26 | | to broadcast events to other systems or over websockets. Samples of 27 | | each available type of connection are provided inside this array. 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'pusher' => [ 34 | 'driver' => 'pusher', 35 | 'key' => env('PUSHER_KEY'), 36 | 'secret' => env('PUSHER_SECRET'), 37 | 'app_id' => env('PUSHER_APP_ID'), 38 | 'options' => [ 39 | // 40 | ], 41 | ], 42 | 43 | 'redis' => [ 44 | 'driver' => 'redis', 45 | 'connection' => 'default', 46 | ], 47 | 48 | 'log' => [ 49 | 'driver' => 'log', 50 | ], 51 | 52 | 'null' => [ 53 | 'driver' => 'null', 54 | ], 55 | 56 | ], 57 | 58 | ]; 59 | -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_DRIVER', 'file'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Cache Stores 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the cache "stores" for your application as 26 | | well as their drivers. You may even define multiple stores for the 27 | | same cache driver to group types of items stored in your caches. 28 | | 29 | */ 30 | 31 | 'stores' => [ 32 | 33 | 'apc' => [ 34 | 'driver' => 'apc', 35 | ], 36 | 37 | 'array' => [ 38 | 'driver' => 'array', 39 | ], 40 | 41 | 'database' => [ 42 | 'driver' => 'database', 43 | 'table' => 'cache', 44 | 'connection' => null, 45 | ], 46 | 47 | 'file' => [ 48 | 'driver' => 'file', 49 | 'path' => storage_path('framework/cache'), 50 | ], 51 | 52 | 'memcached' => [ 53 | 'driver' => 'memcached', 54 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), 55 | 'sasl' => [ 56 | env('MEMCACHED_USERNAME'), 57 | env('MEMCACHED_PASSWORD'), 58 | ], 59 | 'options' => [ 60 | // Memcached::OPT_CONNECT_TIMEOUT => 2000, 61 | ], 62 | 'servers' => [ 63 | [ 64 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 65 | 'port' => env('MEMCACHED_PORT', 11211), 66 | 'weight' => 100, 67 | ], 68 | ], 69 | ], 70 | 71 | 'redis' => [ 72 | 'driver' => 'redis', 73 | 'connection' => 'default', 74 | ], 75 | 76 | ], 77 | 78 | /* 79 | |-------------------------------------------------------------------------- 80 | | Cache Key Prefix 81 | |-------------------------------------------------------------------------- 82 | | 83 | | When utilizing a RAM based store such as APC or Memcached, there might 84 | | be other applications utilizing the same cache. So, we'll specify a 85 | | value to get prefixed to all our keys so we can avoid collisions. 86 | | 87 | */ 88 | 89 | 'prefix' => 'laravel', 90 | 91 | ]; 92 | -------------------------------------------------------------------------------- /config/compile.php: -------------------------------------------------------------------------------- 1 | [ 17 | // 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled File Providers 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may list service providers which define a "compiles" function 26 | | that returns additional files that should be compiled, providing an 27 | | easy way to get common files from any packages you are utilizing. 28 | | 29 | */ 30 | 31 | 'providers' => [ 32 | // 33 | ], 34 | 35 | ]; 36 | -------------------------------------------------------------------------------- /config/filesystems.php: -------------------------------------------------------------------------------- 1 | 'local', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Default Cloud Filesystem Disk 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Many applications store files both locally and in the cloud. For this 26 | | reason, you may specify a default "cloud" driver here. This driver 27 | | will be bound as the Cloud disk implementation in the container. 28 | | 29 | */ 30 | 31 | 'cloud' => 's3', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Filesystem Disks 36 | |-------------------------------------------------------------------------- 37 | | 38 | | Here you may configure as many filesystem "disks" as you wish, and you 39 | | may even configure multiple disks of the same driver. Defaults have 40 | | been setup for each driver as an example of the required options. 41 | | 42 | */ 43 | 44 | 'disks' => [ 45 | 46 | 'local' => [ 47 | 'driver' => 'local', 48 | 'root' => storage_path('app'), 49 | ], 50 | 51 | 'public' => [ 52 | 'driver' => 'local', 53 | 'root' => storage_path('app/public'), 54 | 'visibility' => 'public', 55 | ], 56 | 57 | 's3' => [ 58 | 'driver' => 's3', 59 | 'key' => 'your-key', 60 | 'secret' => 'your-secret', 61 | 'region' => 'your-region', 62 | 'bucket' => 'your-bucket', 63 | ], 64 | 65 | ], 66 | 67 | ]; 68 | -------------------------------------------------------------------------------- /config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_DRIVER', 'sync'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Queue Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may configure the connection information for each server that 26 | | is used by your application. A default configuration has been added 27 | | for each back-end shipped with Laravel. You are free to add more. 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'sync' => [ 34 | 'driver' => 'sync', 35 | ], 36 | 37 | 'database' => [ 38 | 'driver' => 'database', 39 | 'table' => 'jobs', 40 | 'queue' => 'default', 41 | 'retry_after' => 90, 42 | ], 43 | 44 | 'beanstalkd' => [ 45 | 'driver' => 'beanstalkd', 46 | 'host' => 'localhost', 47 | 'queue' => 'default', 48 | 'retry_after' => 90, 49 | ], 50 | 51 | 'sqs' => [ 52 | 'driver' => 'sqs', 53 | 'key' => 'your-public-key', 54 | 'secret' => 'your-secret-key', 55 | 'prefix' => 'https://sqs.us-east-1.amazonaws.com/your-account-id', 56 | 'queue' => 'your-queue-name', 57 | 'region' => 'us-east-1', 58 | ], 59 | 60 | 'redis' => [ 61 | 'driver' => 'redis', 62 | 'connection' => 'default', 63 | 'queue' => 'default', 64 | 'retry_after' => 90, 65 | ], 66 | 67 | ], 68 | 69 | /* 70 | |-------------------------------------------------------------------------- 71 | | Failed Queue Jobs 72 | |-------------------------------------------------------------------------- 73 | | 74 | | These options configure the behavior of failed queue job logging so you 75 | | can control which database and table are used to store the jobs that 76 | | have failed. You may change them to any database / table you wish. 77 | | 78 | */ 79 | 80 | 'failed' => [ 81 | 'database' => env('DB_CONNECTION', 'mysql'), 82 | 'table' => 'failed_jobs', 83 | ], 84 | 85 | ]; 86 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | ], 21 | 22 | 'ses' => [ 23 | 'key' => env('SES_KEY'), 24 | 'secret' => env('SES_SECRET'), 25 | 'region' => 'us-east-1', 26 | ], 27 | 28 | 'sparkpost' => [ 29 | 'secret' => env('SPARKPOST_SECRET'), 30 | ], 31 | 32 | 'stripe' => [ 33 | 'model' => App\User::class, 34 | 'key' => env('STRIPE_KEY'), 35 | 'secret' => env('STRIPE_SECRET'), 36 | ], 37 | 38 | ]; 39 | -------------------------------------------------------------------------------- /config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | realpath(base_path('resources/views')), 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => realpath(storage_path('framework/views')), 32 | 33 | ]; 34 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | -------------------------------------------------------------------------------- /database/factories/ModelFactory.php: -------------------------------------------------------------------------------- 1 | define(App\User::class, function (Faker\Generator $faker) { 15 | static $password; 16 | 17 | return [ 18 | 'name' => $faker->name, 19 | 'email' => $faker->safeEmail, 20 | 'password' => $password ?: $password = bcrypt('secret'), 21 | 'remember_token' => str_random(10), 22 | ]; 23 | }); 24 | -------------------------------------------------------------------------------- /database/migrations/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('name'); 19 | $table->string('email')->unique(); 20 | $table->string('password', 60)->nullable(); 21 | $table->string('confirmation_code'); 22 | $table->boolean('confirmed')->default(config('access.users.confirm_email') ? false : true); 23 | $table->rememberToken(); 24 | $table->timestamps(); 25 | $table->softDeletes(); 26 | }); 27 | } 28 | 29 | /** 30 | * Reverse the migrations. 31 | * 32 | * @return void 33 | */ 34 | public function down() 35 | { 36 | Schema::drop('users'); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_100000_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email')->index(); 18 | $table->string('token')->index(); 19 | $table->timestamp('created_at')->nullable(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::drop('password_resets'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2015_04_27_022849_create_user_providers_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->integer('user_id')->unsigned(); 18 | $table->foreign('user_id')->references('id')->on('users'); 19 | $table->string('provider'); 20 | $table->string('provider_id'); 21 | $table->string('avatar')->nullable(); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::table('user_providers', function (Blueprint $table) { 34 | $table->dropForeign('user_providers_user_id_foreign'); 35 | }); 36 | Schema::drop('user_providers'); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /database/seeds/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /database/seeds/Access/PermissionDependencyTableSeeder.php: -------------------------------------------------------------------------------- 1 | truncate(); 19 | } elseif (env('DB_CONNECTION') == 'sqlite') { 20 | DB::statement('DELETE FROM '.config('access.permission_dependencies_table')); 21 | } else { //For PostgreSQL or anything else 22 | DB::statement('TRUNCATE TABLE '.config('access.permission_dependencies_table').' CASCADE'); 23 | } 24 | 25 | //View access management needs view backend 26 | DB::table(config('access.permission_dependencies_table'))->insert([ 27 | 'permission_id' => 2, 28 | 'dependency_id' => 1, 29 | ]); 30 | 31 | //All of the access permissions need view access management and view backend 32 | for ($i = 3; $i <= 23; $i++) { 33 | DB::table(config('access.permission_dependencies_table'))->insert( 34 | [ 35 | 'permission_id' => $i, 36 | 'dependency_id' => 1, 37 | ] 38 | ); 39 | 40 | DB::table(config('access.permission_dependencies_table'))->insert([ 41 | 'permission_id' => $i, 42 | 'dependency_id' => 2, 43 | ]); 44 | } 45 | 46 | if (env('DB_CONNECTION') == 'mysql') { 47 | DB::statement('SET FOREIGN_KEY_CHECKS=1;'); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /database/seeds/Access/PermissionGroupTableSeeder.php: -------------------------------------------------------------------------------- 1 | truncate(); 16 | } elseif (env('DB_CONNECTION') == 'sqlite') { 17 | DB::statement('DELETE FROM '.config('access.permission_group_table')); 18 | } else { //For PostgreSQL or anything else 19 | DB::statement('TRUNCATE TABLE '.config('access.permission_group_table').' CASCADE'); 20 | } 21 | 22 | /** 23 | * Create the Access groups. 24 | */ 25 | $group_model = config('access.group'); 26 | $access = new $group_model(); 27 | $access->name = 'Access'; 28 | $access->sort = 1; 29 | $access->save(); 30 | 31 | $group_model = config('access.group'); 32 | $user = new $group_model(); 33 | $user->name = 'User'; 34 | $user->sort = 1; 35 | $user->parent_id = $access->id; 36 | $user->save(); 37 | 38 | $group_model = config('access.group'); 39 | $role = new $group_model(); 40 | $role->name = 'Role'; 41 | $role->sort = 2; 42 | $role->parent_id = $access->id; 43 | $role->save(); 44 | 45 | $group_model = config('access.group'); 46 | $permission = new $group_model(); 47 | $permission->name = 'Permission'; 48 | $permission->sort = 3; 49 | $permission->parent_id = $access->id; 50 | $permission->save(); 51 | 52 | if (env('DB_CONNECTION') == 'mysql') { 53 | DB::statement('SET FOREIGN_KEY_CHECKS=1;'); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /database/seeds/Access/RoleTableSeeder.php: -------------------------------------------------------------------------------- 1 | truncate(); 16 | } elseif (env('DB_CONNECTION') == 'sqlite') { 17 | DB::statement('DELETE FROM '.config('access.roles_table')); 18 | } else { //For PostgreSQL or anything else 19 | DB::statement('TRUNCATE TABLE '.config('access.roles_table').' CASCADE'); 20 | } 21 | 22 | $roles = [ 23 | [ 24 | 'name' => 'Admin', 25 | 'all' => true, 26 | 'sort' => 1, 27 | 'created_at'=> date('Y-m-d H:i:s'), 28 | 'updated_at'=> date('Y-m-d H:i:s'), 29 | ], 30 | [ 31 | 'name' => 'User', 32 | 'all' => false, 33 | 'sort' => 2, 34 | 'created_at'=> date('Y-m-d H:i:s'), 35 | 'updated_at'=> date('Y-m-d H:i:s'), 36 | ], 37 | ]; 38 | 39 | config('access.role')::insert($roles); 40 | 41 | if (env('DB_CONNECTION') == 'mysql') { 42 | DB::statement('SET FOREIGN_KEY_CHECKS=1;'); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /database/seeds/Access/UserRoleSeeder.php: -------------------------------------------------------------------------------- 1 | truncate(); 16 | } elseif (env('DB_CONNECTION') == 'sqlite') { 17 | DB::statement('DELETE FROM '.config('access.assigned_roles_table')); 18 | } else { //For PostgreSQL or anything else 19 | DB::statement('TRUNCATE TABLE '.config('access.assigned_roles_table').' CASCADE'); 20 | } 21 | 22 | //Attach admin role to admin user 23 | config('auth.model')::find(1)->roles()->sync([1]); 24 | 25 | //Attach user role to general user 26 | config('auth.model')::find(2)->roles()->sync([2]); 27 | 28 | if (env('DB_CONNECTION') == 'mysql') { 29 | DB::statement('SET FOREIGN_KEY_CHECKS=1;'); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/seeds/Access/UserTableSeeder.php: -------------------------------------------------------------------------------- 1 | truncate(); 16 | } elseif (env('DB_CONNECTION') == 'sqlite') { 17 | DB::statement('DELETE FROM '.config('auth.table')); 18 | } else { //For PostgreSQL or anything else 19 | DB::statement('TRUNCATE TABLE '.config('auth.table').' CASCADE'); 20 | } 21 | 22 | //Add the master administrator, user id of 1 23 | $users = [ 24 | [ 25 | 'name' => 'Admin user', 26 | 'email' => 'admin@example.com', 27 | 'password' => bcrypt('admin'), 28 | 'confirmation_code' => md5(uniqid(mt_rand(), true)), 29 | 'confirmed' => true, 30 | 'created_at' => date('Y-m-d H:i:s'), 31 | 'updated_at' => date('Y-m-d H:i:s'), 32 | ], 33 | [ 34 | 'name' => 'Guest User', 35 | 'email' => 'guest@example.com', 36 | 'password' => bcrypt('guest'), 37 | 'confirmation_code' => md5(uniqid(mt_rand(), true)), 38 | 'confirmed' => true, 39 | 'created_at' => date('Y-m-d H:i:s'), 40 | 'updated_at' => date('Y-m-d H:i:s'), 41 | ], 42 | ]; 43 | 44 | DB::table(config('auth.table'))->insert($users); 45 | 46 | if (env('DB_CONNECTION') == 'mysql') { 47 | DB::statement('SET FOREIGN_KEY_CHECKS=1;'); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /database/seeds/AccessTableSeeder.php: -------------------------------------------------------------------------------- 1 | call(UserTableSeeder::class); 15 | $this->call(RoleTableSeeder::class); 16 | $this->call(UserRoleSeeder::class); 17 | $this->call(PermissionGroupTableSeeder::class); 18 | $this->call(PermissionTableSeeder::class); 19 | $this->call(PermissionDependencyTableSeeder::class); 20 | 21 | if (env('DB_CONNECTION') == 'mysql') { 22 | DB::statement('SET FOREIGN_KEY_CHECKS=1;'); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call(AccessTableSeeder::class); 22 | 23 | if (env('DB_CONNECTION') == 'mysql') { 24 | DB::statement('SET FOREIGN_KEY_CHECKS=1;'); 25 | } 26 | 27 | Model::reguard(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | const elixir = require('laravel-elixir'); 2 | 3 | 4 | // elixir.ready(function () { 5 | // elixir.webpack.mergeConfig({ 6 | // resolve: { 7 | // extensions:[".jsx"] 8 | // }, 9 | // module: { 10 | // loaders: [ 11 | // { test: /\.jsx?$/, loader: 'babel' } 12 | // ] 13 | // 14 | // } 15 | // }) 16 | // }); 17 | 18 | 19 | require('laravel-elixir-vue-2'); 20 | require('laravel-elixir-vueify'); 21 | 22 | /* 23 | |-------------------------------------------------------------------------- 24 | | Elixir Asset Management 25 | |-------------------------------------------------------------------------- 26 | | 27 | | Elixir provides a clean, fluent API for defining some basic Gulp tasks 28 | | for your Laravel application. By default, we are compiling the Sass 29 | | file for our application, as well as publishing vendor resources. 30 | | 31 | */ 32 | 33 | elixir(mix => { 34 | mix.sass('app.scss') 35 | //mix.less('app.less') 36 | .webpack('app.js') 37 | // .browserify('app.js') 38 | 39 | .copy('node_modules/bootstrap-sass/assets/fonts/bootstrap/', 'public/fonts/bootstrap'); 40 | }); 41 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "prod": "gulp --production", 5 | "dev": "gulp watch" 6 | }, 7 | "devDependencies": { 8 | "babel-cli": "^6.16.0", 9 | "babel-core": "^6.17.0", 10 | "babel-helper-vue-jsx-merge-props": "^2.0.1", 11 | "babel-loader": "^6.2.5", 12 | "babel-plugin-transform-vue-jsx": "^3.1.0", 13 | "babel-preset-es2015": "^6.16.0", 14 | "babel-preset-flow-vue": "^1.0.0", 15 | "bootstrap-sass": "^3.3.7", 16 | "gulp": "^3.9.1", 17 | "html-loader": "^0.4.4", 18 | "jquery": "^3.1.0", 19 | "laravel-elixir": "^6.0.0-9", 20 | "laravel-elixir-browserify-official": "^0.1.3", 21 | "laravel-elixir-vue-2": "^0.2.0", 22 | "laravel-elixir-vueify": "^2.0.0", 23 | "laravel-elixir-webpack-official": "^1.0.6", 24 | "lodash": "^4.14.0", 25 | "stringify": "^5.1.0", 26 | "vue": "^2.0.0-rc.7", 27 | "vue-resource": "^0.9.3" 28 | }, 29 | "dependencies": { 30 | "moment": "^2.15.1", 31 | "vue-router": "^2.0.0-rc.7", 32 | "vue-tables-2": "0.0.9" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | ./tests 14 | 15 | 16 | 17 | 18 | ./app 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Redirect Trailing Slashes If Not A Folder... 9 | RewriteCond %{REQUEST_FILENAME} !-d 10 | RewriteRule ^(.*)/$ /$1 [L,R=301] 11 | 12 | # Handle Front Controller... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_FILENAME} !-f 15 | RewriteRule ^ index.php [L] 16 | 17 | # Handle Authorization Header 18 | RewriteCond %{HTTP:Authorization} . 19 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 20 | 21 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sureshamk/laravel-5.3-boilerplate-api-jwt-vue2/9c5d400430050eed120605911ed09ad915a0aa2b/public/favicon.ico -------------------------------------------------------------------------------- /public/fonts/bootstrap/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sureshamk/laravel-5.3-boilerplate-api-jwt-vue2/9c5d400430050eed120605911ed09ad915a0aa2b/public/fonts/bootstrap/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /public/fonts/bootstrap/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sureshamk/laravel-5.3-boilerplate-api-jwt-vue2/9c5d400430050eed120605911ed09ad915a0aa2b/public/fonts/bootstrap/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /public/fonts/bootstrap/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sureshamk/laravel-5.3-boilerplate-api-jwt-vue2/9c5d400430050eed120605911ed09ad915a0aa2b/public/fonts/bootstrap/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /public/fonts/bootstrap/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sureshamk/laravel-5.3-boilerplate-api-jwt-vue2/9c5d400430050eed120605911ed09ad915a0aa2b/public/fonts/bootstrap/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | 9 | /* 10 | |-------------------------------------------------------------------------- 11 | | Register The Auto Loader 12 | |-------------------------------------------------------------------------- 13 | | 14 | | Composer provides a convenient, automatically generated class loader for 15 | | our application. We just need to utilize it! We'll simply require it 16 | | into the script here so that we don't have to worry about manual 17 | | loading any of our classes later on. It feels nice to relax. 18 | | 19 | */ 20 | 21 | require __DIR__.'/../bootstrap/autoload.php'; 22 | 23 | /* 24 | |-------------------------------------------------------------------------- 25 | | Turn On The Lights 26 | |-------------------------------------------------------------------------- 27 | | 28 | | We need to illuminate PHP development, so let us turn on the lights. 29 | | This bootstraps the framework and gets it ready for use, then it 30 | | will load up this application so that we can run it and send 31 | | the responses back to the browser and delight our users. 32 | | 33 | */ 34 | 35 | $app = require_once __DIR__.'/../bootstrap/app.php'; 36 | 37 | /* 38 | |-------------------------------------------------------------------------- 39 | | Run The Application 40 | |-------------------------------------------------------------------------- 41 | | 42 | | Once we have the application, we can handle the incoming request 43 | | through the kernel, and send the associated response back to 44 | | the client's browser allowing them to enjoy the creative 45 | | and wonderful application we have prepared for them. 46 | | 47 | */ 48 | 49 | $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); 50 | 51 | $response = $kernel->handle( 52 | $request = Illuminate\Http\Request::capture() 53 | ); 54 | 55 | $response->send(); 56 | 57 | $kernel->terminate($request, $response); 58 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Laravel PHP Framework 2 | 3 | [![Build Status](https://travis-ci.org/laravel/framework.svg)](https://travis-ci.org/laravel/framework) 4 | [![Total Downloads](https://poser.pugx.org/laravel/framework/d/total.svg)](https://packagist.org/packages/laravel/framework) 5 | [![Latest Stable Version](https://poser.pugx.org/laravel/framework/v/stable.svg)](https://packagist.org/packages/laravel/framework) 6 | [![Latest Unstable Version](https://poser.pugx.org/laravel/framework/v/unstable.svg)](https://packagist.org/packages/laravel/framework) 7 | [![License](https://poser.pugx.org/laravel/framework/license.svg)](https://packagist.org/packages/laravel/framework) 8 | 9 | Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling. Laravel attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as authentication, routing, sessions, queueing, and caching. 10 | 11 | Laravel is accessible, yet powerful, providing tools needed for large, robust applications. A superb inversion of control container, expressive migration system, and tightly integrated unit testing support give you the tools you need to build any application with which you are tasked. 12 | 13 | ## Official Documentation 14 | 15 | Documentation for the framework can be found on the [Laravel website](http://laravel.com/docs). 16 | 17 | ## Contributing 18 | 19 | Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](http://laravel.com/docs/contributions). 20 | 21 | ## Security Vulnerabilities 22 | 23 | If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell at taylor@laravel.com. All security vulnerabilities will be promptly addressed. 24 | 25 | ## License 26 | 27 | The Laravel framework is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT). 28 | -------------------------------------------------------------------------------- /resources/assets/bootstrap-less/mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------------------------------- 3 | // Utilities 4 | @import "mixins/hide-text.less"; 5 | @import "mixins/opacity.less"; 6 | @import "mixins/image.less"; 7 | @import "mixins/labels.less"; 8 | @import "mixins/reset-filter.less"; 9 | @import "mixins/resize.less"; 10 | @import "mixins/responsive-visibility.less"; 11 | @import "mixins/size.less"; 12 | @import "mixins/tab-focus.less"; 13 | @import "mixins/reset-text.less"; 14 | @import "mixins/text-emphasis.less"; 15 | @import "mixins/text-overflow.less"; 16 | @import "mixins/vendor-prefixes.less"; 17 | // Components 18 | @import "mixins/alerts.less"; 19 | @import "mixins/buttons.less"; 20 | @import "mixins/panels.less"; 21 | @import "mixins/pagination.less"; 22 | @import "mixins/list-group.less"; 23 | @import "mixins/nav-divider.less"; 24 | @import "mixins/forms.less"; 25 | @import "mixins/progress-bar.less"; 26 | @import "mixins/table-row.less"; 27 | // Skins 28 | @import "mixins/background-variant.less"; 29 | @import "mixins/border-radius.less"; 30 | @import "mixins/gradients.less"; 31 | // Layout 32 | @import "mixins/clearfix.less"; 33 | @import "mixins/center-block.less"; 34 | @import "mixins/nav-vertical-align.less"; 35 | @import "mixins/grid-framework.less"; 36 | @import "mixins/grid.less"; 37 | -------------------------------------------------------------------------------- /resources/assets/bootstrap-less/mixins/alerts.less: -------------------------------------------------------------------------------- 1 | // Alerts 2 | 3 | .alert-variant(@background; @border; @text-color) { 4 | background-color: @background; 5 | border-color: @border; 6 | color: @text-color; 7 | 8 | hr { 9 | border-top-color: darken(@border, 5%); 10 | } 11 | .alert-link { 12 | color: darken(@text-color, 10%); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /resources/assets/bootstrap-less/mixins/background-variant.less: -------------------------------------------------------------------------------- 1 | // Contextual backgrounds 2 | 3 | .bg-variant(@color) { 4 | background-color: @color; 5 | a&:hover, 6 | a&:focus { 7 | background-color: darken(@color, 10%); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /resources/assets/bootstrap-less/mixins/border-radius.less: -------------------------------------------------------------------------------- 1 | // Single side border-radius 2 | 3 | .border-top-radius(@radius) { 4 | border-top-right-radius: @radius; 5 | border-top-left-radius: @radius; 6 | } 7 | 8 | .border-right-radius(@radius) { 9 | border-bottom-right-radius: @radius; 10 | border-top-right-radius: @radius; 11 | } 12 | 13 | .border-bottom-radius(@radius) { 14 | border-bottom-right-radius: @radius; 15 | border-bottom-left-radius: @radius; 16 | } 17 | 18 | .border-left-radius(@radius) { 19 | border-bottom-left-radius: @radius; 20 | border-top-left-radius: @radius; 21 | } 22 | -------------------------------------------------------------------------------- /resources/assets/bootstrap-less/mixins/buttons.less: -------------------------------------------------------------------------------- 1 | // Button variants 2 | // 3 | // Easily pump out default styles, as well as :hover, :focus, :active, 4 | // and disabled options for all buttons 5 | 6 | .button-variant(@color; @background; @border) { 7 | color: @color; 8 | background-color: @background; 9 | border-color: @border; 10 | 11 | &:focus, 12 | &.focus { 13 | color: @color; 14 | background-color: darken(@background, 10%); 15 | border-color: darken(@border, 25%); 16 | } 17 | &:hover { 18 | color: @color; 19 | background-color: darken(@background, 10%); 20 | border-color: darken(@border, 12%); 21 | } 22 | &:active, 23 | &.active, 24 | .open > .dropdown-toggle& { 25 | color: @color; 26 | background-color: darken(@background, 10%); 27 | border-color: darken(@border, 12%); 28 | 29 | &:hover, 30 | &:focus, 31 | &.focus { 32 | color: @color; 33 | background-color: darken(@background, 17%); 34 | border-color: darken(@border, 25%); 35 | } 36 | } 37 | &:active, 38 | &.active, 39 | .open > .dropdown-toggle& { 40 | background-image: none; 41 | } 42 | &.disabled, 43 | &[disabled], 44 | fieldset[disabled] & { 45 | &, 46 | &:hover, 47 | &:focus, 48 | &.focus, 49 | &:active, 50 | &.active { 51 | background-color: @background; 52 | border-color: @border; 53 | } 54 | } 55 | 56 | .badge { 57 | color: @background; 58 | background-color: @color; 59 | } 60 | } 61 | 62 | // Button sizes 63 | .button-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) { 64 | padding: @padding-vertical @padding-horizontal; 65 | font-size: @font-size; 66 | line-height: @line-height; 67 | border-radius: @border-radius; 68 | } 69 | -------------------------------------------------------------------------------- /resources/assets/bootstrap-less/mixins/center-block.less: -------------------------------------------------------------------------------- 1 | // Center-align a block level element 2 | 3 | .center-block() { 4 | display: block; 5 | margin-left: auto; 6 | margin-right: auto; 7 | } 8 | -------------------------------------------------------------------------------- /resources/assets/bootstrap-less/mixins/clearfix.less: -------------------------------------------------------------------------------- 1 | // Clearfix 2 | // 3 | // For modern browsers 4 | // 1. The space content is one way to avoid an Opera bug when the 5 | // contenteditable attribute is included anywhere else in the document. 6 | // Otherwise it causes space to appear at the top and bottom of elements 7 | // that are clearfixed. 8 | // 2. The use of `table` rather than `block` is only necessary if using 9 | // `:before` to contain the top-margins of child elements. 10 | // 11 | // Source: http://nicolasgallagher.com/micro-clearfix-hack/ 12 | 13 | .clearfix() { 14 | &:before, 15 | &:after { 16 | content: " "; // 1 17 | display: table; // 2 18 | } 19 | &:after { 20 | clear: both; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /resources/assets/bootstrap-less/mixins/forms.less: -------------------------------------------------------------------------------- 1 | // Form validation states 2 | // 3 | // Used in forms.less to generate the form validation CSS for warnings, errors, 4 | // and successes. 5 | 6 | .form-control-validation(@text-color: #555; @border-color: #ccc; @background-color: #f5f5f5) { 7 | // Color the label and help text 8 | .help-block, 9 | .control-label, 10 | .radio, 11 | .checkbox, 12 | .radio-inline, 13 | .checkbox-inline, 14 | &.radio label, 15 | &.checkbox label, 16 | &.radio-inline label, 17 | &.checkbox-inline label { 18 | color: @text-color; 19 | } 20 | // Set the border and box shadow on specific inputs to match 21 | .form-control { 22 | border-color: @border-color; 23 | .box-shadow(inset 0 1px 1px rgba(0, 0, 0, .075)); // Redeclare so transitions work 24 | &:focus { 25 | border-color: darken(@border-color, 10%); 26 | @shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px lighten(@border-color, 20%); 27 | .box-shadow(@shadow); 28 | } 29 | } 30 | // Set validation states also for addons 31 | .input-group-addon { 32 | color: @text-color; 33 | border-color: @border-color; 34 | background-color: @background-color; 35 | } 36 | // Optional feedback icon 37 | .form-control-feedback { 38 | color: @text-color; 39 | } 40 | } 41 | 42 | // Form control focus state 43 | // 44 | // Generate a customized focus state and for any input with the specified color, 45 | // which defaults to the `@input-border-focus` variable. 46 | // 47 | // We highly encourage you to not customize the default value, but instead use 48 | // this to tweak colors on an as-needed basis. This aesthetic change is based on 49 | // WebKit's default styles, but applicable to a wider range of browsers. Its 50 | // usability and accessibility should be taken into account with any change. 51 | // 52 | // Example usage: change the default blue border and shadow to white for better 53 | // contrast against a dark gray background. 54 | .form-control-focus(@color: @input-border-focus) { 55 | @color-rgba: rgba(red(@color), green(@color), blue(@color), .6); 56 | &:focus { 57 | border-color: @color; 58 | outline: 0; 59 | .box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @{color-rgba}"); 60 | } 61 | } 62 | 63 | // Form control sizing 64 | // 65 | // Relative text size, padding, and border-radii changes for form controls. For 66 | // horizontal sizing, wrap controls in the predefined grid classes. ` 25 | 26 | @if ($errors->has('email')) 27 | 28 | {{ $errors->first('email') }} 29 | 30 | @endif 31 | 32 | 33 | 34 |
35 |
36 | 39 |
40 |
41 | 42 | 43 | 44 | 45 | 46 | 47 | @endsection 48 | -------------------------------------------------------------------------------- /resources/views/errors/503.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Be right back. 5 | 6 | 7 | 8 | 39 | 40 | 41 |
42 |
43 |
Be right back.
44 |
45 |
46 | 47 | 48 | -------------------------------------------------------------------------------- /resources/views/home.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Dashboard
9 | 10 |
11 | You are logged in! 12 |
13 |
14 | @if(Auth::user()->hasRole('Admin')) 15 |
16 |
Admin role
17 | 18 | 19 |
20 | admin is logged in 21 |
22 | 23 |
24 | @endif 25 |
26 |
27 |
28 | @endsection 29 | -------------------------------------------------------------------------------- /resources/views/vendor/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /resources/views/welcome.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Laravel 9 | 10 | 11 | 12 | 13 | 14 | 66 | 67 | 68 |
69 | @if (Route::has('login')) 70 | 74 | @endif 75 | 76 |
77 |
78 | Laravel Boilerplate App 79 |
80 | 81 | 90 |
91 |
92 | 93 | 94 | -------------------------------------------------------------------------------- /routes/api.php: -------------------------------------------------------------------------------- 1 | user(); 16 | //})->middleware('auth:api'); 17 | 18 | $api = app('Dingo\Api\Routing\Router'); 19 | $api->version('v1', function ($api) { 20 | $api->post('auth/login', 'App\Api\V1\Controllers\AuthController@login'); 21 | $api->post('auth/signup', 'App\Api\V1\Controllers\AuthController@signup'); 22 | $api->post('auth/recovery', 'App\Api\V1\Controllers\AuthController@recovery'); 23 | $api->post('auth/reset', 'App\Api\V1\Controllers\AuthController@reset'); 24 | // example of protected route 25 | $api->group(['middleware'=>'api.auth'], 26 | function ($api) { 27 | $api->post('auth/me', 'App\Api\V1\Controllers\AuthController@me'); 28 | $api->resource('users', 'App\Api\V1\Controllers\UserController'); 29 | $api->resource('roles', 'App\Api\V1\Controllers\RoleController'); 30 | $api->resource('permissions', 'App\Api\V1\Controllers\PermissionController'); 31 | $api->resource('permissions-groups', 'App\Api\V1\Controllers\PermissionGroupController'); 32 | } 33 | ); 34 | }); 35 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 18 | }); 19 | -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | 'auth'], function () { 20 | Route::get('/home', 'HomeController@index'); 21 | }); 22 | 23 | Route::get('/admin', 'HomeController@adminIndex'); 24 | -------------------------------------------------------------------------------- /server.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $uri = urldecode( 9 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) 10 | ); 11 | 12 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the 13 | // built-in PHP web server. This provides a convenient way to test a Laravel 14 | // application without having installed a "real" web server software here. 15 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { 16 | return false; 17 | } 18 | 19 | require_once __DIR__.'/public/index.php'; 20 | -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/.gitignore: -------------------------------------------------------------------------------- 1 | config.php 2 | routes.php 3 | schedule-* 4 | compiled.php 5 | services.json 6 | events.scanned.php 7 | routes.scanned.php 8 | down 9 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/oauth-public.key: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAzudrw2Vd+5DICa00iGTJ 3 | KNVOtDKtmBOccld1iWql+33GoN7vvv+E4ou5tHuQJIjgCwfq459jbXa3OP0X0X/K 4 | CNGCQfvZoEput4FXK9maw3Jhjv3gw+ZVcySrJGjRoC8DYlSjsMGStj0h/fIHE0LD 5 | +Quj9sLMlgrSLpx2SSzs1AwIVdT3Z5tHHVuqUBdUbhY+RLK1AXeMGjRa900h5Jjz 6 | u5R0vYZFu/JPVfkYkvPBX6dY/6mO4MVzkciv6dh8Gbpy9yG5cODIXWEd4hGJt4Uf 7 | Dan2m2w3b28djTk4cQHsHk/PGIEUycd2pF5ER+1vMxv7QFoNb/9Aj+1JQEYfsRQO 8 | mLIzZEnd5vysr5NLFQ41oEk7pLQavbODExdL6AvNSZLFkUVJ8IJshldgqmLZrytC 9 | jff/yxa2hsqqej0PeHQ6actF1CkzlcDaVS8N+A7q9mO80LOsz+CelU2F+WvN4jsh 10 | TcDCh/ApBp+MMueWqST2wbdLoZfdMlr4eFCDXDLX6Y7AjIaq9yDkZpbpttpQNAC5 11 | hgFzj4Lsv/moTVMC6SGGe1WtoajoPbqDW/aeQtRcmVlvEYAiYssYzQJbj+9slGBL 12 | gVvz4pCF/Ppcek3TG5m9YLa65dYyG0c6DE08SDtmzcXFlPxhtzWodsVr2qEQhtUS 13 | k6uKIAzcSI3kqCup4793KC0CAwEAAQ== 14 | -----END PUBLIC KEY----- 15 | -------------------------------------------------------------------------------- /tests/ExampleTest.php: -------------------------------------------------------------------------------- 1 | visit('/') 14 | ->see('Laravel'); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | make(Illuminate\Contracts\Console\Kernel::class)->bootstrap(); 22 | 23 | return $app; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | module: { 3 | loaders: [ 4 | { 5 | test: /\.(js|jsx)$/, 6 | loader: "babel-loader", 7 | query: {compact: false} 8 | } 9 | ] 10 | }, 11 | resolve: { 12 | alias: { 13 | 'jquery': require.resolve('jquery'), 14 | } 15 | } 16 | }; -------------------------------------------------------------------------------- /webpack.config.js.bkp: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const path = require('path'); 4 | 5 | module.exports = { 6 | module: { 7 | loaders: [ 8 | { 9 | test: /\.html$/, 10 | loader: 'html' 11 | }, 12 | { 13 | test: /\.vue$/, 14 | loader: 'vue' 15 | } 16 | ] 17 | }, 18 | resolve: { 19 | alias: { 20 | vue: 'vue/dist/vue.js' 21 | } 22 | } 23 | } --------------------------------------------------------------------------------