├── .angulardoc.json ├── README.md ├── api ├── .env.example ├── .gitattributes ├── .gitignore ├── app │ ├── Console │ │ └── Kernel.php │ ├── Exceptions │ │ └── Handler.php │ ├── Http │ │ ├── Controllers │ │ │ ├── Api │ │ │ │ └── AuthController.php │ │ │ ├── Auth │ │ │ │ ├── ForgotPasswordController.php │ │ │ │ ├── LoginController.php │ │ │ │ ├── RegisterController.php │ │ │ │ └── ResetPasswordController.php │ │ │ └── Controller.php │ │ ├── Kernel.php │ │ └── Middleware │ │ │ ├── EncryptCookies.php │ │ │ ├── RedirectIfAuthenticated.php │ │ │ ├── TrimStrings.php │ │ │ ├── TrustProxies.php │ │ │ └── VerifyCsrfToken.php │ ├── Providers │ │ ├── AppServiceProvider.php │ │ ├── AuthServiceProvider.php │ │ ├── BroadcastServiceProvider.php │ │ ├── EventServiceProvider.php │ │ └── RouteServiceProvider.php │ └── User.php ├── artisan ├── bootstrap │ ├── app.php │ └── cache │ │ └── .gitignore ├── composer.json ├── composer.lock ├── config │ ├── app.php │ ├── auth.php │ ├── broadcasting.php │ ├── cache.php │ ├── cors.php │ ├── database.php │ ├── filesystems.php │ ├── jwt.php │ ├── mail.php │ ├── queue.php │ ├── services.php │ ├── session.php │ └── view.php ├── database │ ├── .gitignore │ ├── factories │ │ └── UserFactory.php │ ├── migrations │ │ ├── 2014_10_12_000000_create_users_table.php │ │ └── 2014_10_12_100000_create_password_resets_table.php │ └── seeds │ │ ├── DatabaseSeeder.php │ │ └── UsersTableSeeder.php ├── package.json ├── phpunit.xml ├── public │ ├── .htaccess │ ├── css │ │ └── app.css │ ├── favicon.ico │ ├── index.php │ ├── js │ │ └── app.js │ ├── robots.txt │ └── web.config ├── readme.md ├── resources │ ├── assets │ │ ├── js │ │ │ ├── app.js │ │ │ ├── bootstrap.js │ │ │ └── components │ │ │ │ └── Example.vue │ │ └── sass │ │ │ ├── _variables.scss │ │ │ └── app.scss │ ├── lang │ │ └── en │ │ │ ├── auth.php │ │ │ ├── pagination.php │ │ │ ├── passwords.php │ │ │ └── validation.php │ └── views │ │ └── welcome.blade.php ├── routes │ ├── api.php │ ├── channels.php │ ├── console.php │ └── web.php ├── server.php ├── storage │ ├── app │ │ ├── .gitignore │ │ └── public │ │ │ └── .gitignore │ ├── framework │ │ ├── .gitignore │ │ ├── cache │ │ │ └── .gitignore │ │ ├── sessions │ │ │ └── .gitignore │ │ ├── testing │ │ │ └── .gitignore │ │ └── views │ │ │ └── .gitignore │ └── logs │ │ └── .gitignore ├── tests │ ├── CreatesApplication.php │ ├── Feature │ │ └── ExampleTest.php │ ├── TestCase.php │ └── Unit │ │ └── ExampleTest.php └── webpack.mix.js └── web ├── .angular-cli.json ├── .editorconfig ├── .gitignore ├── LICENSE ├── README.md ├── e2e ├── app.e2e-spec.ts ├── app.po.ts └── tsconfig.e2e.json ├── karma.conf.js ├── package.json ├── protractor.conf.js ├── src ├── _variables.less ├── app │ ├── admin │ │ ├── admin-content │ │ │ ├── admin-content.component.css │ │ │ ├── admin-content.component.html │ │ │ ├── admin-content.component.spec.ts │ │ │ └── admin-content.component.ts │ │ ├── admin-control-sidebar │ │ │ ├── admin-control-sidebar.component.css │ │ │ ├── admin-control-sidebar.component.html │ │ │ ├── admin-control-sidebar.component.spec.ts │ │ │ └── admin-control-sidebar.component.ts │ │ ├── admin-dashboard1 │ │ │ ├── admin-dashboard1.component.css │ │ │ ├── admin-dashboard1.component.html │ │ │ ├── admin-dashboard1.component.spec.ts │ │ │ └── admin-dashboard1.component.ts │ │ ├── admin-dashboard2 │ │ │ ├── admin-dashboard2.component.css │ │ │ ├── admin-dashboard2.component.html │ │ │ ├── admin-dashboard2.component.spec.ts │ │ │ └── admin-dashboard2.component.ts │ │ ├── admin-footer │ │ │ ├── admin-footer.component.css │ │ │ ├── admin-footer.component.html │ │ │ ├── admin-footer.component.spec.ts │ │ │ └── admin-footer.component.ts │ │ ├── admin-header │ │ │ ├── admin-header.component.css │ │ │ ├── admin-header.component.html │ │ │ ├── admin-header.component.spec.ts │ │ │ └── admin-header.component.ts │ │ ├── admin-left-side │ │ │ ├── admin-left-side.component.css │ │ │ ├── admin-left-side.component.html │ │ │ ├── admin-left-side.component.spec.ts │ │ │ └── admin-left-side.component.ts │ │ ├── admin-routing │ │ │ └── admin-routing.module.ts │ │ ├── admin.component.css │ │ ├── admin.component.html │ │ ├── admin.component.spec.ts │ │ ├── admin.component.ts │ │ └── admin.module.ts │ ├── app-routing │ │ └── app-routing.module.ts │ ├── app.component.css │ ├── app.component.html │ ├── app.component.spec.ts │ ├── app.component.ts │ ├── app.error-handle.ts │ ├── app.module.ts │ ├── auth │ │ ├── auth.module.ts │ │ ├── interfaces │ │ │ └── user.model.ts │ │ ├── login │ │ │ ├── login.component.css │ │ │ ├── login.component.html │ │ │ └── login.component.ts │ │ ├── profile │ │ │ ├── profile.component.css │ │ │ ├── profile.component.html │ │ │ └── profile.component.ts │ │ └── services │ │ │ └── auth.service.ts │ ├── guards │ │ └── auth.guard.ts │ ├── interceptors │ │ ├── refresh-token.interceptor.ts │ │ └── token.interceptor.ts │ └── starter │ │ ├── starter-content │ │ ├── starter-content.component.css │ │ ├── starter-content.component.html │ │ ├── starter-content.component.spec.ts │ │ └── starter-content.component.ts │ │ ├── starter-control-sidebar │ │ ├── starter-control-sidebar.component.css │ │ ├── starter-control-sidebar.component.html │ │ ├── starter-control-sidebar.component.spec.ts │ │ └── starter-control-sidebar.component.ts │ │ ├── starter-footer │ │ ├── starter-footer.component.css │ │ ├── starter-footer.component.html │ │ ├── starter-footer.component.spec.ts │ │ └── starter-footer.component.ts │ │ ├── starter-header │ │ ├── starter-header.component.css │ │ ├── starter-header.component.html │ │ ├── starter-header.component.spec.ts │ │ └── starter-header.component.ts │ │ ├── starter-left-side │ │ ├── starter-left-side.component.css │ │ ├── starter-left-side.component.html │ │ ├── starter-left-side.component.spec.ts │ │ └── starter-left-side.component.ts │ │ ├── starter.component.css │ │ ├── starter.component.html │ │ ├── starter.component.spec.ts │ │ └── starter.component.ts ├── assets │ ├── .gitkeep │ ├── admin.less │ ├── img │ │ ├── avatar.png │ │ ├── avatar04.png │ │ ├── avatar2.png │ │ ├── avatar3.png │ │ ├── avatar5.png │ │ ├── boxed-bg.jpg │ │ ├── boxed-bg.png │ │ ├── credit │ │ │ ├── american-express.png │ │ │ ├── cirrus.png │ │ │ ├── mastercard.png │ │ │ ├── mestro.png │ │ │ ├── paypal.png │ │ │ ├── paypal2.png │ │ │ └── visa.png │ │ ├── default-50x50.gif │ │ ├── icons.png │ │ ├── photo1.png │ │ ├── photo2.png │ │ ├── photo3.jpg │ │ ├── photo4.jpg │ │ ├── user1-128x128.jpg │ │ ├── user2-160x160.jpg │ │ ├── user3-128x128.jpg │ │ ├── user4-128x128.jpg │ │ ├── user5-128x128.jpg │ │ ├── user6-128x128.jpg │ │ ├── user7-128x128.jpg │ │ └── user8-128x128.jpg │ └── js │ │ └── scripts.js ├── environments │ ├── environment.prod.ts │ └── environment.ts ├── favicon.ico ├── index.html ├── main.ts ├── polyfills.ts ├── styles.css ├── test.ts ├── tsconfig.app.json ├── tsconfig.spec.json └── typings.d.ts ├── tsconfig.json └── tslint.json /.angulardoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "repoId": "4ba4cb21-5e1d-445d-bf2d-4a43db05cf55", 3 | "lastSync": 0 4 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Curso Laravel 5.5 + JWT + Angular 4.4 2 | 3 | Um série de vídeos do canal [TJGWeb](http://youtube.com/c/TJGWeb) para solucionar diversas dúvidas de implementação de comunicação entre Backend e Front-end utilizando tokens de acesso com JWT. 4 | 5 | Vamos criar uma API utilizando o famoso Laravel na sua nova versão 5.5 e Angular 4.4 como front-end, falando sobre os novos recursos em ambos para esse tipo de situação. Vou abordar os conceitos de autenticação e autorização de usuários e como integrar o JWT em ambos para permitir essa comunicação. 6 | 7 | [**Playlist dos vídeos**](https://www.youtube.com/watch?v=qA5bwYfmAqE&list=PLSYIyzca1f9zdXl6l7y2GkxwYsUfXGGCf) 8 | 9 | ## Instruções 10 | - No **Branche Master** será mantido o conteúdo mais recente. 11 | - As **Tags** serão usadas para manter as versões dos arquivos por cada vídeo. Será marcada uma tag com o mesmo número do vídeo, portanto o conteúdo irá refletir o código do momento da gravação e não terá as alterações futuras, mantendo a compatibilidade e facilidade de acompanhamento da vídeo aula. 12 | 13 | 14 | ### Agradecimentos 15 | - [Laravel](https://laravel.com/) 16 | - [tymon/jwt-auth](https://github.com/tymondesigns/jwt-auth) 17 | - [barryvdh/laravel-cors](https://github.com/barryvdh/laravel-cors) 18 | - [Angular](https://angular.io/) 19 | - [csotomon/Angular2-AdminLTE](https://github.com/csotomon/Angular2-AdminLTE) 20 | - [JWT](https://jwt.io/) 21 | - [AdminLTE](https://adminlte.io/) 22 | 23 | 24 | 25 | ### License 26 | [MIT license](http://opensource.org/licenses/MIT) -------------------------------------------------------------------------------- /api/.env.example: -------------------------------------------------------------------------------- 1 | APP_NAME=Laravel 2 | APP_ENV=local 3 | APP_KEY= 4 | APP_DEBUG=true 5 | APP_LOG_LEVEL=debug 6 | APP_URL=http://localhost 7 | 8 | DB_CONNECTION=mysql 9 | DB_HOST=127.0.0.1 10 | DB_PORT=3306 11 | DB_DATABASE=homestead 12 | DB_USERNAME=homestead 13 | DB_PASSWORD=secret 14 | 15 | BROADCAST_DRIVER=log 16 | CACHE_DRIVER=file 17 | SESSION_DRIVER=file 18 | QUEUE_DRIVER=sync 19 | 20 | REDIS_HOST=127.0.0.1 21 | REDIS_PASSWORD=null 22 | REDIS_PORT=6379 23 | 24 | MAIL_DRIVER=smtp 25 | MAIL_HOST=smtp.mailtrap.io 26 | MAIL_PORT=2525 27 | MAIL_USERNAME=null 28 | MAIL_PASSWORD=null 29 | MAIL_ENCRYPTION=null 30 | 31 | PUSHER_APP_ID= 32 | PUSHER_APP_KEY= 33 | PUSHER_APP_SECRET= 34 | -------------------------------------------------------------------------------- /api/.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.css linguist-vendored 3 | *.scss linguist-vendored 4 | *.js linguist-vendored 5 | CHANGELOG.md export-ignore 6 | -------------------------------------------------------------------------------- /api/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /public/hot 3 | /public/storage 4 | /storage/*.key 5 | /vendor 6 | /.idea 7 | /.vagrant 8 | Homestead.json 9 | Homestead.yaml 10 | npm-debug.log 11 | yarn-error.log 12 | .env 13 | -------------------------------------------------------------------------------- /api/app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire') 28 | // ->hourly(); 29 | } 30 | 31 | /** 32 | * Register the commands for the application. 33 | * 34 | * @return void 35 | */ 36 | protected function commands() 37 | { 38 | $this->load(__DIR__.'/Commands'); 39 | 40 | require base_path('routes/console.php'); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /api/app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | json(['error' => 'token_expired'], $exception->getStatusCode()); 53 | } 54 | else if ($exception instanceof \Tymon\JWTAuth\Exceptions\TokenInvalidException) { 55 | return response()->json(['error' => 'token_invalid'], $exception->getStatusCode()); 56 | } 57 | else if ($exception instanceof \Tymon\JWTAuth\Exceptions\JWTException) { 58 | return response()->json(['error' => $exception->getMessage()], $exception->getStatusCode()); 59 | } 60 | else if ($exception instanceof \Tymon\JWTAuth\Exceptions\TokenBlacklistedException){ 61 | return response()->json(['error' => 'token_has_been_blacklisted'], $exception->getStatusCode()); 62 | } 63 | 64 | return parent::render($request, $exception); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /api/app/Http/Controllers/Api/AuthController.php: -------------------------------------------------------------------------------- 1 | jwtAuth = $jwtAuth; 18 | } 19 | 20 | public function login(Request $request) 21 | { 22 | $credentials = $request->only('email', 'password'); 23 | 24 | if (!$token = $this->jwtAuth->attempt($credentials)) { 25 | return response()->json(['error' => 'invalid_credentials'], 401); 26 | } 27 | 28 | $user = $this->jwtAuth->authenticate($token); 29 | 30 | return response()->json(compact('token', 'user')); 31 | } 32 | 33 | public function refresh() 34 | { 35 | $token = $this->jwtAuth->getToken(); 36 | $token = $this->jwtAuth->refresh($token); 37 | 38 | return response()->json(compact('token')); 39 | } 40 | 41 | public function logout() 42 | { 43 | $token = $this->jwtAuth->getToken(); 44 | $this->jwtAuth->invalidate($token); 45 | 46 | return response()->json(['logout']); 47 | } 48 | 49 | public function me() 50 | { 51 | if (!$user = $this->jwtAuth->parseToken()->authenticate()) { 52 | return response()->json(['error' => 'user_not_found'], 404); 53 | } 54 | 55 | return response()->json(compact('user')); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /api/app/Http/Controllers/Auth/ForgotPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /api/app/Http/Controllers/Auth/LoginController.php: -------------------------------------------------------------------------------- 1 | middleware('guest')->except('logout'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /api/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 | * @return \Illuminate\Contracts\Validation\Validator 47 | */ 48 | protected function validator(array $data) 49 | { 50 | return Validator::make($data, [ 51 | 'name' => 'required|string|max:255', 52 | 'email' => 'required|string|email|max:255|unique:users', 53 | 'password' => 'required|string|min:6|confirmed', 54 | ]); 55 | } 56 | 57 | /** 58 | * Create a new user instance after a valid registration. 59 | * 60 | * @param array $data 61 | * @return \App\User 62 | */ 63 | protected function create(array $data) 64 | { 65 | return User::create([ 66 | 'name' => $data['name'], 67 | 'email' => $data['email'], 68 | 'password' => bcrypt($data['password']), 69 | ]); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /api/app/Http/Controllers/Auth/ResetPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /api/app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | [ 31 | \App\Http\Middleware\EncryptCookies::class, 32 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, 33 | \Illuminate\Session\Middleware\StartSession::class, 34 | // \Illuminate\Session\Middleware\AuthenticateSession::class, 35 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 36 | \App\Http\Middleware\VerifyCsrfToken::class, 37 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 38 | ], 39 | 40 | 'api' => [ 41 | 'throttle:60,1', 42 | 'bindings', 43 | \Barryvdh\Cors\HandleCors::class, 44 | ], 45 | ]; 46 | 47 | /** 48 | * The application's route middleware. 49 | * 50 | * These middleware may be assigned to groups or used individually. 51 | * 52 | * @var array 53 | */ 54 | protected $routeMiddleware = [ 55 | 'auth' => \Illuminate\Auth\Middleware\Authenticate::class, 56 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 57 | 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, 58 | 'can' => \Illuminate\Auth\Middleware\Authorize::class, 59 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 60 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 61 | 'jwt.auth' => \Tymon\JWTAuth\Middleware\GetUserFromToken::class, 62 | 'jwt.refresh' => \Tymon\JWTAuth\Middleware\RefreshToken::class, 63 | ]; 64 | } 65 | -------------------------------------------------------------------------------- /api/app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | check()) { 21 | return redirect('/home'); 22 | } 23 | 24 | return $next($request); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /api/app/Http/Middleware/TrimStrings.php: -------------------------------------------------------------------------------- 1 | 'FORWARDED', 24 | Request::HEADER_X_FORWARDED_FOR => 'X_FORWARDED_FOR', 25 | Request::HEADER_X_FORWARDED_HOST => 'X_FORWARDED_HOST', 26 | Request::HEADER_X_FORWARDED_PORT => 'X_FORWARDED_PORT', 27 | Request::HEADER_X_FORWARDED_PROTO => 'X_FORWARDED_PROTO', 28 | ]; 29 | } 30 | -------------------------------------------------------------------------------- /api/app/Http/Middleware/VerifyCsrfToken.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 | 28 | // 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /api/app/Providers/BroadcastServiceProvider.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 | -------------------------------------------------------------------------------- /api/app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | mapApiRoutes(); 39 | 40 | $this->mapWebRoutes(); 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::middleware('web') 55 | ->namespace($this->namespace) 56 | ->group(base_path('routes/web.php')); 57 | } 58 | 59 | /** 60 | * Define the "api" routes for the application. 61 | * 62 | * These routes are typically stateless. 63 | * 64 | * @return void 65 | */ 66 | protected function mapApiRoutes() 67 | { 68 | Route::prefix('api') 69 | ->middleware('api') 70 | ->namespace($this->namespace) 71 | ->group(base_path('routes/api.php')); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /api/app/User.php: -------------------------------------------------------------------------------- 1 | make(Illuminate\Contracts\Console\Kernel::class); 34 | 35 | $status = $kernel->handle( 36 | $input = new Symfony\Component\Console\Input\ArgvInput, 37 | new Symfony\Component\Console\Output\ConsoleOutput 38 | ); 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Shutdown The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once Artisan has finished running, we will fire off the shutdown events 46 | | so that any final work may be done by the application before we shut 47 | | down the process. This is the last thing to happen to the request. 48 | | 49 | */ 50 | 51 | $kernel->terminate($input, $status); 52 | 53 | exit($status); 54 | -------------------------------------------------------------------------------- /api/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 | -------------------------------------------------------------------------------- /api/bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /api/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel/laravel", 3 | "description": "The Laravel Framework.", 4 | "keywords": ["framework", "laravel"], 5 | "license": "MIT", 6 | "type": "project", 7 | "require": { 8 | "php": ">=7.0.0", 9 | "barryvdh/laravel-cors": "^0.10.0", 10 | "fideloper/proxy": "~3.3", 11 | "laravel/framework": "5.5.*", 12 | "laravel/tinker": "~1.0", 13 | "tymon/jwt-auth": "0.5.12" 14 | }, 15 | "require-dev": { 16 | "filp/whoops": "~2.0", 17 | "fzaninotto/faker": "~1.4", 18 | "mockery/mockery": "0.9.*", 19 | "phpunit/phpunit": "~6.0" 20 | }, 21 | "autoload": { 22 | "classmap": [ 23 | "database/seeds", 24 | "database/factories" 25 | ], 26 | "psr-4": { 27 | "App\\": "app/" 28 | } 29 | }, 30 | "autoload-dev": { 31 | "psr-4": { 32 | "Tests\\": "tests/" 33 | } 34 | }, 35 | "extra": { 36 | "laravel": { 37 | "dont-discover": [ 38 | ] 39 | } 40 | }, 41 | "scripts": { 42 | "post-root-package-install": [ 43 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 44 | ], 45 | "post-create-project-cmd": [ 46 | "@php artisan key:generate" 47 | ], 48 | "post-autoload-dump": [ 49 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", 50 | "@php artisan package:discover" 51 | ] 52 | }, 53 | "config": { 54 | "preferred-install": "dist", 55 | "sort-packages": true, 56 | "optimize-autoloader": true 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /api/config/auth.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'guard' => 'web', 18 | 'passwords' => 'users', 19 | ], 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Authentication Guards 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Next, you may define every authentication guard for your application. 27 | | Of course, a great default configuration has been defined for you 28 | | here which uses session storage and the Eloquent user provider. 29 | | 30 | | All authentication drivers have a user provider. This defines how the 31 | | users are actually retrieved out of your database or other storage 32 | | mechanisms used by this application to persist your user's data. 33 | | 34 | | Supported: "session", "token" 35 | | 36 | */ 37 | 38 | 'guards' => [ 39 | 'web' => [ 40 | 'driver' => 'session', 41 | 'provider' => 'users', 42 | ], 43 | 44 | 'api' => [ 45 | 'driver' => 'token', 46 | 'provider' => 'users', 47 | ], 48 | ], 49 | 50 | /* 51 | |-------------------------------------------------------------------------- 52 | | User Providers 53 | |-------------------------------------------------------------------------- 54 | | 55 | | All authentication drivers have a user provider. This defines how the 56 | | users are actually retrieved out of your database or other storage 57 | | mechanisms used by this application to persist your user's data. 58 | | 59 | | If you have multiple user tables or models you may configure multiple 60 | | sources which represent each model / table. These sources may then 61 | | be assigned to any extra authentication guards you have defined. 62 | | 63 | | Supported: "database", "eloquent" 64 | | 65 | */ 66 | 67 | 'providers' => [ 68 | 'users' => [ 69 | 'driver' => 'eloquent', 70 | 'model' => App\User::class, 71 | ], 72 | 73 | // 'users' => [ 74 | // 'driver' => 'database', 75 | // 'table' => 'users', 76 | // ], 77 | ], 78 | 79 | /* 80 | |-------------------------------------------------------------------------- 81 | | Resetting Passwords 82 | |-------------------------------------------------------------------------- 83 | | 84 | | You may specify multiple password reset configurations if you have more 85 | | than one user table or model in the application and you want to have 86 | | separate password reset settings based on the specific user types. 87 | | 88 | | The expire time is the number of minutes that the reset token should be 89 | | considered valid. This security feature keeps tokens short-lived so 90 | | they have less time to be guessed. You may change this as needed. 91 | | 92 | */ 93 | 94 | 'passwords' => [ 95 | 'users' => [ 96 | 'provider' => 'users', 97 | 'table' => 'password_resets', 98 | 'expire' => 60, 99 | ], 100 | ], 101 | 102 | ]; 103 | -------------------------------------------------------------------------------- /api/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_APP_KEY'), 36 | 'secret' => env('PUSHER_APP_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 | -------------------------------------------------------------------------------- /api/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/data'), 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 | -------------------------------------------------------------------------------- /api/config/cors.php: -------------------------------------------------------------------------------- 1 | false, 16 | 'allowedOrigins' => ['*'], 17 | 'allowedHeaders' => ['*'], 18 | 'allowedMethods' => ['*'], 19 | 'exposedHeaders' => [], 20 | 'maxAge' => 0, 21 | 22 | ]; 23 | -------------------------------------------------------------------------------- /api/config/database.php: -------------------------------------------------------------------------------- 1 | env('DB_CONNECTION', 'mysql'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Database Connections 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here are each of the database connections setup for your application. 24 | | Of course, examples of configuring each database platform that is 25 | | supported by Laravel is shown below to make development simple. 26 | | 27 | | 28 | | All database work in Laravel is done through the PHP PDO facilities 29 | | so make sure you have the driver for your particular database of 30 | | choice installed on your machine before you begin development. 31 | | 32 | */ 33 | 34 | 'connections' => [ 35 | 36 | 'sqlite' => [ 37 | 'driver' => 'sqlite', 38 | 'database' => env('DB_DATABASE', database_path('database.sqlite')), 39 | 'prefix' => '', 40 | ], 41 | 42 | 'mysql' => [ 43 | 'driver' => 'mysql', 44 | 'host' => env('DB_HOST', '127.0.0.1'), 45 | 'port' => env('DB_PORT', '3306'), 46 | 'database' => env('DB_DATABASE', 'forge'), 47 | 'username' => env('DB_USERNAME', 'forge'), 48 | 'password' => env('DB_PASSWORD', ''), 49 | 'unix_socket' => env('DB_SOCKET', ''), 50 | 'charset' => 'utf8mb4', 51 | 'collation' => 'utf8mb4_unicode_ci', 52 | 'prefix' => '', 53 | 'strict' => true, 54 | 'engine' => null, 55 | ], 56 | 57 | 'pgsql' => [ 58 | 'driver' => 'pgsql', 59 | 'host' => env('DB_HOST', '127.0.0.1'), 60 | 'port' => env('DB_PORT', '5432'), 61 | 'database' => env('DB_DATABASE', 'forge'), 62 | 'username' => env('DB_USERNAME', 'forge'), 63 | 'password' => env('DB_PASSWORD', ''), 64 | 'charset' => 'utf8', 65 | 'prefix' => '', 66 | 'schema' => 'public', 67 | 'sslmode' => 'prefer', 68 | ], 69 | 70 | 'sqlsrv' => [ 71 | 'driver' => 'sqlsrv', 72 | 'host' => env('DB_HOST', 'localhost'), 73 | 'port' => env('DB_PORT', '1433'), 74 | 'database' => env('DB_DATABASE', 'forge'), 75 | 'username' => env('DB_USERNAME', 'forge'), 76 | 'password' => env('DB_PASSWORD', ''), 77 | 'charset' => 'utf8', 78 | 'prefix' => '', 79 | ], 80 | 81 | ], 82 | 83 | /* 84 | |-------------------------------------------------------------------------- 85 | | Migration Repository Table 86 | |-------------------------------------------------------------------------- 87 | | 88 | | This table keeps track of all the migrations that have already run for 89 | | your application. Using this information, we can determine which of 90 | | the migrations on disk haven't actually been run in the database. 91 | | 92 | */ 93 | 94 | 'migrations' => 'migrations', 95 | 96 | /* 97 | |-------------------------------------------------------------------------- 98 | | Redis Databases 99 | |-------------------------------------------------------------------------- 100 | | 101 | | Redis is an open source, fast, and advanced key-value store that also 102 | | provides a richer set of commands than a typical key-value systems 103 | | such as APC or Memcached. Laravel makes it easy to dig right in. 104 | | 105 | */ 106 | 107 | 'redis' => [ 108 | 109 | 'client' => 'predis', 110 | 111 | 'default' => [ 112 | 'host' => env('REDIS_HOST', '127.0.0.1'), 113 | 'password' => env('REDIS_PASSWORD', null), 114 | 'port' => env('REDIS_PORT', 6379), 115 | 'database' => 0, 116 | ], 117 | 118 | ], 119 | 120 | ]; 121 | -------------------------------------------------------------------------------- /api/config/filesystems.php: -------------------------------------------------------------------------------- 1 | env('FILESYSTEM_DRIVER', 'local'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Default Cloud Filesystem Disk 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Many applications store files both locally and in the cloud. For this 24 | | reason, you may specify a default "cloud" driver here. This driver 25 | | will be bound as the Cloud disk implementation in the container. 26 | | 27 | */ 28 | 29 | 'cloud' => env('FILESYSTEM_CLOUD', 's3'), 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Filesystem Disks 34 | |-------------------------------------------------------------------------- 35 | | 36 | | Here you may configure as many filesystem "disks" as you wish, and you 37 | | may even configure multiple disks of the same driver. Defaults have 38 | | been setup for each driver as an example of the required options. 39 | | 40 | | Supported Drivers: "local", "ftp", "s3", "rackspace" 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 | 'url' => env('APP_URL').'/storage', 55 | 'visibility' => 'public', 56 | ], 57 | 58 | 's3' => [ 59 | 'driver' => 's3', 60 | 'key' => env('AWS_KEY'), 61 | 'secret' => env('AWS_SECRET'), 62 | 'region' => env('AWS_REGION'), 63 | 'bucket' => env('AWS_BUCKET'), 64 | ], 65 | 66 | ], 67 | 68 | ]; 69 | -------------------------------------------------------------------------------- /api/config/jwt.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | return [ 13 | 14 | /* 15 | |-------------------------------------------------------------------------- 16 | | JWT Authentication Secret 17 | |-------------------------------------------------------------------------- 18 | | 19 | | Don't forget to set this, as it will be used to sign your tokens. 20 | | A helper command is provided for this: `php artisan jwt:generate` 21 | | 22 | */ 23 | 24 | 'secret' => env('JWT_SECRET', 'changeme'), 25 | 26 | /* 27 | |-------------------------------------------------------------------------- 28 | | JWT time to live 29 | |-------------------------------------------------------------------------- 30 | | 31 | | Specify the length of time (in minutes) that the token will be valid for. 32 | | Defaults to 1 hour 33 | | 34 | */ 35 | 36 | 'ttl' => 60, 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Refresh time to live 41 | |-------------------------------------------------------------------------- 42 | | 43 | | Specify the length of time (in minutes) that the token can be refreshed 44 | | within. I.E. The user can refresh their token within a 2 week window of 45 | | the original token being created until they must re-authenticate. 46 | | Defaults to 2 weeks 20160 47 | | 48 | */ 49 | 50 | 'refresh_ttl' => 20160, 51 | 52 | /* 53 | |-------------------------------------------------------------------------- 54 | | JWT hashing algorithm 55 | |-------------------------------------------------------------------------- 56 | | 57 | | Specify the hashing algorithm that will be used to sign the token. 58 | | 59 | | See here: https://github.com/namshi/jose/tree/2.2.0/src/Namshi/JOSE/Signer 60 | | for possible values 61 | | 62 | */ 63 | 64 | 'algo' => 'HS256', 65 | 66 | /* 67 | |-------------------------------------------------------------------------- 68 | | User Model namespace 69 | |-------------------------------------------------------------------------- 70 | | 71 | | Specify the full namespace to your User model. 72 | | e.g. 'Acme\Entities\User' 73 | | 74 | */ 75 | 76 | 'user' => 'App\User', 77 | 78 | /* 79 | |-------------------------------------------------------------------------- 80 | | User identifier 81 | |-------------------------------------------------------------------------- 82 | | 83 | | Specify a unique property of the user that will be added as the 'sub' 84 | | claim of the token payload. 85 | | 86 | */ 87 | 88 | 'identifier' => 'id', 89 | 90 | /* 91 | |-------------------------------------------------------------------------- 92 | | Required Claims 93 | |-------------------------------------------------------------------------- 94 | | 95 | | Specify the required claims that must exist in any token. 96 | | A TokenInvalidException will be thrown if any of these claims are not 97 | | present in the payload. 98 | | 99 | */ 100 | 101 | 'required_claims' => ['iss', 'iat', 'exp', 'nbf', 'sub', 'jti'], 102 | 103 | /* 104 | |-------------------------------------------------------------------------- 105 | | Blacklist Enabled 106 | |-------------------------------------------------------------------------- 107 | | 108 | | In order to invalidate tokens, you must have the blacklist enabled. 109 | | If you do not want or need this functionality, then set this to false. 110 | | 111 | */ 112 | 113 | 'blacklist_enabled' => env('JWT_BLACKLIST_ENABLED', true), 114 | 115 | /* 116 | |-------------------------------------------------------------------------- 117 | | Providers 118 | |-------------------------------------------------------------------------- 119 | | 120 | | Specify the various providers used throughout the package. 121 | | 122 | */ 123 | 124 | 'providers' => [ 125 | 126 | /* 127 | |-------------------------------------------------------------------------- 128 | | User Provider 129 | |-------------------------------------------------------------------------- 130 | | 131 | | Specify the provider that is used to find the user based 132 | | on the subject claim 133 | | 134 | */ 135 | 136 | 'user' => 'Tymon\JWTAuth\Providers\User\EloquentUserAdapter', 137 | 138 | /* 139 | |-------------------------------------------------------------------------- 140 | | JWT Provider 141 | |-------------------------------------------------------------------------- 142 | | 143 | | Specify the provider that is used to create and decode the tokens. 144 | | 145 | */ 146 | 147 | 'jwt' => 'Tymon\JWTAuth\Providers\JWT\NamshiAdapter', 148 | 149 | /* 150 | |-------------------------------------------------------------------------- 151 | | Authentication Provider 152 | |-------------------------------------------------------------------------- 153 | | 154 | | Specify the provider that is used to authenticate users. 155 | | 156 | */ 157 | 158 | 'auth' => 'Tymon\JWTAuth\Providers\Auth\IlluminateAuthAdapter', 159 | 160 | /* 161 | |-------------------------------------------------------------------------- 162 | | Storage Provider 163 | |-------------------------------------------------------------------------- 164 | | 165 | | Specify the provider that is used to store tokens in the blacklist 166 | | 167 | */ 168 | 169 | 'storage' => 'Tymon\JWTAuth\Providers\Storage\IlluminateCacheAdapter', 170 | 171 | ], 172 | 173 | ]; 174 | -------------------------------------------------------------------------------- /api/config/mail.php: -------------------------------------------------------------------------------- 1 | env('MAIL_DRIVER', 'smtp'), 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | SMTP Host Address 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may provide the host address of the SMTP server used by your 27 | | applications. A default option is provided that is compatible with 28 | | the Mailgun mail service which will provide reliable deliveries. 29 | | 30 | */ 31 | 32 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 33 | 34 | /* 35 | |-------------------------------------------------------------------------- 36 | | SMTP Host Port 37 | |-------------------------------------------------------------------------- 38 | | 39 | | This is the SMTP port used by your application to deliver e-mails to 40 | | users of the application. Like the host we have set this value to 41 | | stay compatible with the Mailgun e-mail application by default. 42 | | 43 | */ 44 | 45 | 'port' => env('MAIL_PORT', 587), 46 | 47 | /* 48 | |-------------------------------------------------------------------------- 49 | | Global "From" Address 50 | |-------------------------------------------------------------------------- 51 | | 52 | | You may wish for all e-mails sent by your application to be sent from 53 | | the same address. Here, you may specify a name and address that is 54 | | used globally for all e-mails that are sent by your application. 55 | | 56 | */ 57 | 58 | 'from' => [ 59 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), 60 | 'name' => env('MAIL_FROM_NAME', 'Example'), 61 | ], 62 | 63 | /* 64 | |-------------------------------------------------------------------------- 65 | | E-Mail Encryption Protocol 66 | |-------------------------------------------------------------------------- 67 | | 68 | | Here you may specify the encryption protocol that should be used when 69 | | the application send e-mail messages. A sensible default using the 70 | | transport layer security protocol should provide great security. 71 | | 72 | */ 73 | 74 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'), 75 | 76 | /* 77 | |-------------------------------------------------------------------------- 78 | | SMTP Server Username 79 | |-------------------------------------------------------------------------- 80 | | 81 | | If your SMTP server requires a username for authentication, you should 82 | | set it here. This will get used to authenticate with your server on 83 | | connection. You may also set the "password" value below this one. 84 | | 85 | */ 86 | 87 | 'username' => env('MAIL_USERNAME'), 88 | 89 | 'password' => env('MAIL_PASSWORD'), 90 | 91 | /* 92 | |-------------------------------------------------------------------------- 93 | | Sendmail System Path 94 | |-------------------------------------------------------------------------- 95 | | 96 | | When using the "sendmail" driver to send e-mails, we will need to know 97 | | the path to where Sendmail lives on this server. A default path has 98 | | been provided here, which will work well on most of your systems. 99 | | 100 | */ 101 | 102 | 'sendmail' => '/usr/sbin/sendmail -bs', 103 | 104 | /* 105 | |-------------------------------------------------------------------------- 106 | | Markdown Mail Settings 107 | |-------------------------------------------------------------------------- 108 | | 109 | | If you are using Markdown based email rendering, you may configure your 110 | | theme and component paths here, allowing you to customize the design 111 | | of the emails. Or, you may simply stick with the Laravel defaults! 112 | | 113 | */ 114 | 115 | 'markdown' => [ 116 | 'theme' => 'default', 117 | 118 | 'paths' => [ 119 | resource_path('views/vendor/mail'), 120 | ], 121 | ], 122 | 123 | ]; 124 | -------------------------------------------------------------------------------- /api/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 | -------------------------------------------------------------------------------- /api/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 | -------------------------------------------------------------------------------- /api/config/session.php: -------------------------------------------------------------------------------- 1 | env('SESSION_DRIVER', 'file'), 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Session Lifetime 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may specify the number of minutes that you wish the session 27 | | to be allowed to remain idle before it expires. If you want them 28 | | to immediately expire on the browser closing, set that option. 29 | | 30 | */ 31 | 32 | 'lifetime' => 120, 33 | 34 | 'expire_on_close' => false, 35 | 36 | /* 37 | |-------------------------------------------------------------------------- 38 | | Session Encryption 39 | |-------------------------------------------------------------------------- 40 | | 41 | | This option allows you to easily specify that all of your session data 42 | | should be encrypted before it is stored. All encryption will be run 43 | | automatically by Laravel and you can use the Session like normal. 44 | | 45 | */ 46 | 47 | 'encrypt' => false, 48 | 49 | /* 50 | |-------------------------------------------------------------------------- 51 | | Session File Location 52 | |-------------------------------------------------------------------------- 53 | | 54 | | When using the native session driver, we need a location where session 55 | | files may be stored. A default has been set for you but a different 56 | | location may be specified. This is only needed for file sessions. 57 | | 58 | */ 59 | 60 | 'files' => storage_path('framework/sessions'), 61 | 62 | /* 63 | |-------------------------------------------------------------------------- 64 | | Session Database Connection 65 | |-------------------------------------------------------------------------- 66 | | 67 | | When using the "database" or "redis" session drivers, you may specify a 68 | | connection that should be used to manage these sessions. This should 69 | | correspond to a connection in your database configuration options. 70 | | 71 | */ 72 | 73 | 'connection' => null, 74 | 75 | /* 76 | |-------------------------------------------------------------------------- 77 | | Session Database Table 78 | |-------------------------------------------------------------------------- 79 | | 80 | | When using the "database" session driver, you may specify the table we 81 | | should use to manage the sessions. Of course, a sensible default is 82 | | provided for you; however, you are free to change this as needed. 83 | | 84 | */ 85 | 86 | 'table' => 'sessions', 87 | 88 | /* 89 | |-------------------------------------------------------------------------- 90 | | Session Cache Store 91 | |-------------------------------------------------------------------------- 92 | | 93 | | When using the "apc" or "memcached" session drivers, you may specify a 94 | | cache store that should be used for these sessions. This value must 95 | | correspond with one of the application's configured cache stores. 96 | | 97 | */ 98 | 99 | 'store' => null, 100 | 101 | /* 102 | |-------------------------------------------------------------------------- 103 | | Session Sweeping Lottery 104 | |-------------------------------------------------------------------------- 105 | | 106 | | Some session drivers must manually sweep their storage location to get 107 | | rid of old sessions from storage. Here are the chances that it will 108 | | happen on a given request. By default, the odds are 2 out of 100. 109 | | 110 | */ 111 | 112 | 'lottery' => [2, 100], 113 | 114 | /* 115 | |-------------------------------------------------------------------------- 116 | | Session Cookie Name 117 | |-------------------------------------------------------------------------- 118 | | 119 | | Here you may change the name of the cookie used to identify a session 120 | | instance by ID. The name specified here will get used every time a 121 | | new session cookie is created by the framework for every driver. 122 | | 123 | */ 124 | 125 | 'cookie' => env( 126 | 'SESSION_COOKIE', 127 | str_slug(env('APP_NAME', 'laravel'), '_').'_session' 128 | ), 129 | 130 | /* 131 | |-------------------------------------------------------------------------- 132 | | Session Cookie Path 133 | |-------------------------------------------------------------------------- 134 | | 135 | | The session cookie path determines the path for which the cookie will 136 | | be regarded as available. Typically, this will be the root path of 137 | | your application but you are free to change this when necessary. 138 | | 139 | */ 140 | 141 | 'path' => '/', 142 | 143 | /* 144 | |-------------------------------------------------------------------------- 145 | | Session Cookie Domain 146 | |-------------------------------------------------------------------------- 147 | | 148 | | Here you may change the domain of the cookie used to identify a session 149 | | in your application. This will determine which domains the cookie is 150 | | available to in your application. A sensible default has been set. 151 | | 152 | */ 153 | 154 | 'domain' => env('SESSION_DOMAIN', null), 155 | 156 | /* 157 | |-------------------------------------------------------------------------- 158 | | HTTPS Only Cookies 159 | |-------------------------------------------------------------------------- 160 | | 161 | | By setting this option to true, session cookies will only be sent back 162 | | to the server if the browser has a HTTPS connection. This will keep 163 | | the cookie from being sent to you if it can not be done securely. 164 | | 165 | */ 166 | 167 | 'secure' => env('SESSION_SECURE_COOKIE', false), 168 | 169 | /* 170 | |-------------------------------------------------------------------------- 171 | | HTTP Access Only 172 | |-------------------------------------------------------------------------- 173 | | 174 | | Setting this value to true will prevent JavaScript from accessing the 175 | | value of the cookie and the cookie will only be accessible through 176 | | the HTTP protocol. You are free to modify this option if needed. 177 | | 178 | */ 179 | 180 | 'http_only' => true, 181 | 182 | /* 183 | |-------------------------------------------------------------------------- 184 | | Same-Site Cookies 185 | |-------------------------------------------------------------------------- 186 | | 187 | | This option determines how your cookies behave when cross-site requests 188 | | take place, and can be used to mitigate CSRF attacks. By default, we 189 | | do not enable this as other CSRF protection services are in place. 190 | | 191 | | Supported: "lax", "strict" 192 | | 193 | */ 194 | 195 | 'same_site' => null, 196 | 197 | ]; 198 | -------------------------------------------------------------------------------- /api/config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | resource_path('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 | -------------------------------------------------------------------------------- /api/database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | -------------------------------------------------------------------------------- /api/database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | define(App\User::class, function (Faker $faker) { 17 | static $password; 18 | 19 | return [ 20 | 'name' => $faker->name, 21 | 'email' => $faker->unique()->safeEmail, 22 | 'password' => $password ?: $password = bcrypt('secret'), 23 | 'remember_token' => str_random(10), 24 | ]; 25 | }); 26 | -------------------------------------------------------------------------------- /api/database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('name', 150); 19 | $table->string('email', 50)->unique(); 20 | $table->string('password', 100); 21 | $table->rememberToken(); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('users'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /api/database/migrations/2014_10_12_100000_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email', 50)->index(); 18 | $table->string('token', 200); 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::dropIfExists('password_resets'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /api/database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call(UsersTableSeeder::class); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /api/database/seeds/UsersTableSeeder.php: -------------------------------------------------------------------------------- 1 | create([ 15 | 'name' => 'Talles Gazel', 16 | 'email' => 'admin@gmail.com' 17 | ]); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /api/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "npm run development", 5 | "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", 6 | "watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", 7 | "watch-poll": "npm run watch -- --watch-poll", 8 | "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", 9 | "prod": "npm run production", 10 | "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" 11 | }, 12 | "devDependencies": { 13 | "axios": "^0.16.2", 14 | "bootstrap-sass": "^3.3.7", 15 | "cross-env": "^5.0.1", 16 | "jquery": "^3.1.1", 17 | "laravel-mix": "^1.0", 18 | "lodash": "^4.17.4", 19 | "vue": "^2.1.10" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | ./tests/Feature 14 | 15 | 16 | 17 | ./tests/Unit 18 | 19 | 20 | 21 | 22 | ./app 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /api/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 | RewriteCond %{REQUEST_URI} (.+)/$ 11 | RewriteRule ^ %1 [L,R=301] 12 | 13 | # Handle Front Controller... 14 | RewriteCond %{REQUEST_FILENAME} !-d 15 | RewriteCond %{REQUEST_FILENAME} !-f 16 | RewriteRule ^ index.php [L] 17 | 18 | # Handle Authorization Header 19 | RewriteCond %{HTTP:Authorization} . 20 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 21 | 22 | -------------------------------------------------------------------------------- /api/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/api/public/favicon.ico -------------------------------------------------------------------------------- /api/public/index.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | define('LARAVEL_START', microtime(true)); 11 | 12 | /* 13 | |-------------------------------------------------------------------------- 14 | | Register The Auto Loader 15 | |-------------------------------------------------------------------------- 16 | | 17 | | Composer provides a convenient, automatically generated class loader for 18 | | our application. We just need to utilize it! We'll simply require it 19 | | into the script here so that we don't have to worry about manual 20 | | loading any of our classes later on. It feels great to relax. 21 | | 22 | */ 23 | 24 | require __DIR__.'/../vendor/autoload.php'; 25 | 26 | /* 27 | |-------------------------------------------------------------------------- 28 | | Turn On The Lights 29 | |-------------------------------------------------------------------------- 30 | | 31 | | We need to illuminate PHP development, so let us turn on the lights. 32 | | This bootstraps the framework and gets it ready for use, then it 33 | | will load up this application so that we can run it and send 34 | | the responses back to the browser and delight our users. 35 | | 36 | */ 37 | 38 | $app = require_once __DIR__.'/../bootstrap/app.php'; 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Run The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once we have the application, we can handle the incoming request 46 | | through the kernel, and send the associated response back to 47 | | the client's browser allowing them to enjoy the creative 48 | | and wonderful application we have prepared for them. 49 | | 50 | */ 51 | 52 | $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); 53 | 54 | $response = $kernel->handle( 55 | $request = Illuminate\Http\Request::capture() 56 | ); 57 | 58 | $response->send(); 59 | 60 | $kernel->terminate($request, $response); 61 | -------------------------------------------------------------------------------- /api/public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /api/public/web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /api/readme.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 | Build Status 5 | Total Downloads 6 | Latest Stable Version 7 | License 8 |

9 | 10 | ## About Laravel 11 | 12 | Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and 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: 13 | 14 | - [Simple, fast routing engine](https://laravel.com/docs/routing). 15 | - [Powerful dependency injection container](https://laravel.com/docs/container). 16 | - Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage. 17 | - Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent). 18 | - Database agnostic [schema migrations](https://laravel.com/docs/migrations). 19 | - [Robust background job processing](https://laravel.com/docs/queues). 20 | - [Real-time event broadcasting](https://laravel.com/docs/broadcasting). 21 | 22 | Laravel is accessible, yet powerful, providing tools needed for large, robust applications. A superb combination of simplicity, elegance, and innovation give you tools you need to build any application with which you are tasked. 23 | 24 | ## Learning Laravel 25 | 26 | Laravel has the most extensive and thorough documentation and video tutorial library of any modern web application framework. The [Laravel documentation](https://laravel.com/docs) is thorough, complete, and makes it a breeze to get started learning the framework. 27 | 28 | If you're not in the mood to read, [Laracasts](https://laracasts.com) contains over 900 video tutorials on a range of topics including Laravel, modern PHP, unit testing, JavaScript, and more. Boost the skill level of yourself and your entire team by digging into our comprehensive video library. 29 | 30 | ## Laravel Sponsors 31 | 32 | We would like to extend our thanks to the following sponsors for helping fund on-going Laravel development. If you are interested in becoming a sponsor, please visit the Laravel [Patreon page](http://patreon.com/taylorotwell): 33 | 34 | - **[Vehikl](http://vehikl.com)** 35 | - **[Tighten Co.](https://tighten.co)** 36 | - **[British Software Development](https://www.britishsoftware.co)** 37 | - **[Styde](https://styde.net)** 38 | - [Fragrantica](https://www.fragrantica.com) 39 | - [SOFTonSOFA](https://softonsofa.com/) 40 | - [User10](https://user10.com) 41 | - [Soumettre.fr](https://soumettre.fr/) 42 | 43 | ## Contributing 44 | 45 | Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](http://laravel.com/docs/contributions). 46 | 47 | ## Security Vulnerabilities 48 | 49 | 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. 50 | 51 | ## License 52 | 53 | The Laravel framework is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT). 54 | -------------------------------------------------------------------------------- /api/resources/assets/js/app.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * First we will load all of this project's JavaScript dependencies which 4 | * includes Vue and other libraries. It is a great starting point when 5 | * building robust, powerful web applications using Vue and Laravel. 6 | */ 7 | 8 | require('./bootstrap'); 9 | 10 | window.Vue = require('vue'); 11 | 12 | /** 13 | * Next, we will create a fresh Vue application instance and attach it to 14 | * the page. Then, you may begin adding components to this application 15 | * or customize the JavaScript scaffolding to fit your unique needs. 16 | */ 17 | 18 | Vue.component('example', require('./components/Example.vue')); 19 | 20 | const app = new Vue({ 21 | el: '#app' 22 | }); 23 | -------------------------------------------------------------------------------- /api/resources/assets/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | 2 | window._ = require('lodash'); 3 | 4 | /** 5 | * We'll load jQuery and the Bootstrap jQuery plugin which provides support 6 | * for JavaScript based Bootstrap features such as modals and tabs. This 7 | * code may be modified to fit the specific needs of your application. 8 | */ 9 | 10 | try { 11 | window.$ = window.jQuery = require('jquery'); 12 | 13 | require('bootstrap-sass'); 14 | } catch (e) {} 15 | 16 | /** 17 | * We'll load the axios HTTP library which allows us to easily issue requests 18 | * to our Laravel back-end. This library automatically handles sending the 19 | * CSRF token as a header based on the value of the "XSRF" token cookie. 20 | */ 21 | 22 | window.axios = require('axios'); 23 | 24 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 25 | 26 | /** 27 | * Next we will register the CSRF Token as a common header with Axios so that 28 | * all outgoing HTTP requests automatically have it attached. This is just 29 | * a simple convenience so we don't have to attach every token manually. 30 | */ 31 | 32 | let token = document.head.querySelector('meta[name="csrf-token"]'); 33 | 34 | if (token) { 35 | window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content; 36 | } else { 37 | console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token'); 38 | } 39 | 40 | /** 41 | * Echo exposes an expressive API for subscribing to channels and listening 42 | * for events that are broadcast by Laravel. Echo and event broadcasting 43 | * allows your team to easily build robust real-time web applications. 44 | */ 45 | 46 | // import Echo from 'laravel-echo' 47 | 48 | // window.Pusher = require('pusher-js'); 49 | 50 | // window.Echo = new Echo({ 51 | // broadcaster: 'pusher', 52 | // key: 'your-pusher-key' 53 | // }); 54 | -------------------------------------------------------------------------------- /api/resources/assets/js/components/Example.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 24 | -------------------------------------------------------------------------------- /api/resources/assets/sass/_variables.scss: -------------------------------------------------------------------------------- 1 | 2 | // Body 3 | $body-bg: #f5f8fa; 4 | 5 | // Borders 6 | $laravel-border-color: darken($body-bg, 10%); 7 | $list-group-border: $laravel-border-color; 8 | $navbar-default-border: $laravel-border-color; 9 | $panel-default-border: $laravel-border-color; 10 | $panel-inner-border: $laravel-border-color; 11 | 12 | // Brands 13 | $brand-primary: #3097D1; 14 | $brand-info: #8eb4cb; 15 | $brand-success: #2ab27b; 16 | $brand-warning: #cbb956; 17 | $brand-danger: #bf5329; 18 | 19 | // Typography 20 | $icon-font-path: "~bootstrap-sass/assets/fonts/bootstrap/"; 21 | $font-family-sans-serif: "Raleway", sans-serif; 22 | $font-size-base: 14px; 23 | $line-height-base: 1.6; 24 | $text-color: #636b6f; 25 | 26 | // Navbar 27 | $navbar-default-bg: #fff; 28 | 29 | // Buttons 30 | $btn-default-color: $text-color; 31 | 32 | // Inputs 33 | $input-border: lighten($text-color, 40%); 34 | $input-border-focus: lighten($brand-primary, 25%); 35 | $input-color-placeholder: lighten($text-color, 30%); 36 | 37 | // Panels 38 | $panel-default-heading-bg: #fff; 39 | -------------------------------------------------------------------------------- /api/resources/assets/sass/app.scss: -------------------------------------------------------------------------------- 1 | 2 | // Fonts 3 | @import url("https://fonts.googleapis.com/css?family=Raleway:300,400,600"); 4 | 5 | // Variables 6 | @import "variables"; 7 | 8 | // Bootstrap 9 | @import "~bootstrap-sass/assets/stylesheets/bootstrap"; 10 | -------------------------------------------------------------------------------- /api/resources/lang/en/auth.php: -------------------------------------------------------------------------------- 1 | 'These credentials do not match our records.', 17 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /api/resources/lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /api/resources/lang/en/passwords.php: -------------------------------------------------------------------------------- 1 | 'Passwords must be at least six characters and match the confirmation.', 17 | 'reset' => 'Your password has been reset!', 18 | 'sent' => 'We have e-mailed your password reset link!', 19 | 'token' => 'This password reset token is invalid.', 20 | 'user' => "We can't find a user with that e-mail address.", 21 | 22 | ]; 23 | -------------------------------------------------------------------------------- /api/resources/lang/en/validation.php: -------------------------------------------------------------------------------- 1 | 'The :attribute must be accepted.', 17 | 'active_url' => 'The :attribute is not a valid URL.', 18 | 'after' => 'The :attribute must be a date after :date.', 19 | 'after_or_equal' => 'The :attribute must be a date after or equal to :date.', 20 | 'alpha' => 'The :attribute may only contain letters.', 21 | 'alpha_dash' => 'The :attribute may only contain letters, numbers, and dashes.', 22 | 'alpha_num' => 'The :attribute may only contain letters and numbers.', 23 | 'array' => 'The :attribute must be an array.', 24 | 'before' => 'The :attribute must be a date before :date.', 25 | 'before_or_equal' => 'The :attribute must be a date before or equal to :date.', 26 | 'between' => [ 27 | 'numeric' => 'The :attribute must be between :min and :max.', 28 | 'file' => 'The :attribute must be between :min and :max kilobytes.', 29 | 'string' => 'The :attribute must be between :min and :max characters.', 30 | 'array' => 'The :attribute must have between :min and :max items.', 31 | ], 32 | 'boolean' => 'The :attribute field must be true or false.', 33 | 'confirmed' => 'The :attribute confirmation does not match.', 34 | 'date' => 'The :attribute is not a valid date.', 35 | 'date_format' => 'The :attribute does not match the format :format.', 36 | 'different' => 'The :attribute and :other must be different.', 37 | 'digits' => 'The :attribute must be :digits digits.', 38 | 'digits_between' => 'The :attribute must be between :min and :max digits.', 39 | 'dimensions' => 'The :attribute has invalid image dimensions.', 40 | 'distinct' => 'The :attribute field has a duplicate value.', 41 | 'email' => 'The :attribute must be a valid email address.', 42 | 'exists' => 'The selected :attribute is invalid.', 43 | 'file' => 'The :attribute must be a file.', 44 | 'filled' => 'The :attribute field must have a value.', 45 | 'image' => 'The :attribute must be an image.', 46 | 'in' => 'The selected :attribute is invalid.', 47 | 'in_array' => 'The :attribute field does not exist in :other.', 48 | 'integer' => 'The :attribute must be an integer.', 49 | 'ip' => 'The :attribute must be a valid IP address.', 50 | 'ipv4' => 'The :attribute must be a valid IPv4 address.', 51 | 'ipv6' => 'The :attribute must be a valid IPv6 address.', 52 | 'json' => 'The :attribute must be a valid JSON string.', 53 | 'max' => [ 54 | 'numeric' => 'The :attribute may not be greater than :max.', 55 | 'file' => 'The :attribute may not be greater than :max kilobytes.', 56 | 'string' => 'The :attribute may not be greater than :max characters.', 57 | 'array' => 'The :attribute may not have more than :max items.', 58 | ], 59 | 'mimes' => 'The :attribute must be a file of type: :values.', 60 | 'mimetypes' => 'The :attribute must be a file of type: :values.', 61 | 'min' => [ 62 | 'numeric' => 'The :attribute must be at least :min.', 63 | 'file' => 'The :attribute must be at least :min kilobytes.', 64 | 'string' => 'The :attribute must be at least :min characters.', 65 | 'array' => 'The :attribute must have at least :min items.', 66 | ], 67 | 'not_in' => 'The selected :attribute is invalid.', 68 | 'numeric' => 'The :attribute must be a number.', 69 | 'present' => 'The :attribute field must be present.', 70 | 'regex' => 'The :attribute format is invalid.', 71 | 'required' => 'The :attribute field is required.', 72 | 'required_if' => 'The :attribute field is required when :other is :value.', 73 | 'required_unless' => 'The :attribute field is required unless :other is in :values.', 74 | 'required_with' => 'The :attribute field is required when :values is present.', 75 | 'required_with_all' => 'The :attribute field is required when :values is present.', 76 | 'required_without' => 'The :attribute field is required when :values is not present.', 77 | 'required_without_all' => 'The :attribute field is required when none of :values are present.', 78 | 'same' => 'The :attribute and :other must match.', 79 | 'size' => [ 80 | 'numeric' => 'The :attribute must be :size.', 81 | 'file' => 'The :attribute must be :size kilobytes.', 82 | 'string' => 'The :attribute must be :size characters.', 83 | 'array' => 'The :attribute must contain :size items.', 84 | ], 85 | 'string' => 'The :attribute must be a string.', 86 | 'timezone' => 'The :attribute must be a valid zone.', 87 | 'unique' => 'The :attribute has already been taken.', 88 | 'uploaded' => 'The :attribute failed to upload.', 89 | 'url' => 'The :attribute format is invalid.', 90 | 91 | /* 92 | |-------------------------------------------------------------------------- 93 | | Custom Validation Language Lines 94 | |-------------------------------------------------------------------------- 95 | | 96 | | Here you may specify custom validation messages for attributes using the 97 | | convention "attribute.rule" to name the lines. This makes it quick to 98 | | specify a specific custom language line for a given attribute rule. 99 | | 100 | */ 101 | 102 | 'custom' => [ 103 | 'attribute-name' => [ 104 | 'rule-name' => 'custom-message', 105 | ], 106 | ], 107 | 108 | /* 109 | |-------------------------------------------------------------------------- 110 | | Custom Validation Attributes 111 | |-------------------------------------------------------------------------- 112 | | 113 | | The following language lines are used to swap attribute place-holders 114 | | with something more reader friendly such as E-Mail Address instead 115 | | of "email". This simply helps us make messages a little cleaner. 116 | | 117 | */ 118 | 119 | 'attributes' => [], 120 | 121 | ]; 122 | -------------------------------------------------------------------------------- /api/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 | 78 | @endif 79 | 80 |
81 |
82 | Laravel 83 |
84 | 85 | 92 |
93 |
94 | 95 | 96 | -------------------------------------------------------------------------------- /api/routes/api.php: -------------------------------------------------------------------------------- 1 | 'jwt.auth', 'namespace' => 'Api\\'], function() { 21 | 22 | Route::get('auth/me', 'AuthController@me'); 23 | }); 24 | -------------------------------------------------------------------------------- /api/routes/channels.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 16 | }); 17 | -------------------------------------------------------------------------------- /api/routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 18 | })->describe('Display an inspiring quote'); 19 | -------------------------------------------------------------------------------- /api/routes/web.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | $uri = urldecode( 11 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) 12 | ); 13 | 14 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the 15 | // built-in PHP web server. This provides a convenient way to test a Laravel 16 | // application without having installed a "real" web server software here. 17 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { 18 | return false; 19 | } 20 | 21 | require_once __DIR__.'/public/index.php'; 22 | -------------------------------------------------------------------------------- /api/storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /api/storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /api/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 | -------------------------------------------------------------------------------- /api/storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /api/storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /api/storage/framework/testing/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /api/storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /api/storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /api/tests/CreatesApplication.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 19 | 20 | return $app; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /api/tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 18 | 19 | $response->assertStatus(200); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /api/tests/TestCase.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /api/webpack.mix.js: -------------------------------------------------------------------------------- 1 | let mix = require('laravel-mix'); 2 | 3 | /* 4 | |-------------------------------------------------------------------------- 5 | | Mix Asset Management 6 | |-------------------------------------------------------------------------- 7 | | 8 | | Mix provides a clean, fluent API for defining some Webpack build steps 9 | | for your Laravel application. By default, we are compiling the Sass 10 | | file for the application as well as bundling up all the JS files. 11 | | 12 | */ 13 | 14 | mix.js('resources/assets/js/app.js', 'public/js') 15 | .sass('resources/assets/sass/app.scss', 'public/css'); 16 | -------------------------------------------------------------------------------- /web/.angular-cli.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "project": { 4 | "name": "angular-admin-lte" 5 | }, 6 | "apps": [ 7 | { 8 | "root": "src", 9 | "outDir": "dist", 10 | "assets": [ 11 | "assets", 12 | "favicon.ico" 13 | ], 14 | "index": "index.html", 15 | "main": "main.ts", 16 | "polyfills": "polyfills.ts", 17 | "test": "test.ts", 18 | "tsconfig": "tsconfig.app.json", 19 | "testTsconfig": "tsconfig.spec.json", 20 | "prefix": "app", 21 | "styles": [ 22 | "styles.css", 23 | "../node_modules/bootstrap/dist/css/bootstrap.css", 24 | "../node_modules/font-awesome/css/font-awesome.css", 25 | "../node_modules/ionicons/css/ionicons.css", 26 | "_variables.less", 27 | "../node_modules/icheck/skins/flat/blue.css", 28 | "../node_modules/morris.js/morris.css", 29 | "../node_modules/bootstrap-datepicker/dist/css/bootstrap-datepicker3.css", 30 | "../node_modules/admin-lte/plugins/daterangepicker/daterangepicker.css", 31 | "../node_modules/bootstrap3-wysihtml5-bower/dist/bootstrap3-wysihtml5.css" 32 | ], 33 | "scripts": [ 34 | "../node_modules/jquery/dist/jquery.js", 35 | "../node_modules/jqueryui/jquery-ui.js", 36 | "../node_modules/bootstrap/dist/js/bootstrap.js", 37 | "../node_modules/raphael/raphael.js", 38 | "../node_modules/morris.js/morris.js", 39 | "../node_modules/jquery-sparkline/jquery.sparkline.js", 40 | "../node_modules/jquery-knob/dist/jquery.knob.min.js", 41 | "../node_modules/moment/moment.js", 42 | "../node_modules/daterangepicker/daterangepicker.js", 43 | "../node_modules/bootstrap-datepicker/js/bootstrap-datepicker.js", 44 | "../node_modules/jquery-slimscroll/jquery.slimscroll.js", 45 | "../node_modules/bootstrap3-wysihtml5-bower/dist/bootstrap3-wysihtml5.all.js", 46 | "../node_modules/icheck/icheck.js", 47 | "../node_modules/admin-lte/dist/js/app.js", 48 | "assets/js/scripts.js" 49 | ], 50 | "environmentSource": "environments/environment.ts", 51 | "environments": { 52 | "dev": "environments/environment.ts", 53 | "prod": "environments/environment.prod.ts" 54 | } 55 | } 56 | ], 57 | "e2e": { 58 | "protractor": { 59 | "config": "./protractor.conf.js" 60 | } 61 | }, 62 | "lint": [ 63 | { 64 | "project": "src/tsconfig.app.json" 65 | }, 66 | { 67 | "project": "src/tsconfig.spec.json" 68 | }, 69 | { 70 | "project": "e2e/tsconfig.e2e.json" 71 | } 72 | ], 73 | "test": { 74 | "karma": { 75 | "config": "./karma.conf.js" 76 | } 77 | }, 78 | "defaults": { 79 | "styleExt": "css", 80 | "component": {} 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /web/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /web/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | # !.vscode/settings.json 23 | # !.vscode/tasks.json 24 | # !.vscode/launch.json 25 | # !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | testem.log 34 | /typings 35 | 36 | # e2e 37 | /e2e/*.js 38 | /e2e/*.map 39 | 40 | # System Files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /web/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Camilo Soto Montoya 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 | -------------------------------------------------------------------------------- /web/README.md: -------------------------------------------------------------------------------- 1 | Introduction 2 | ============ 3 | 4 | This is the **Angular** version of **AdminLTE** -- what is a fully responsive admin template. Based on **[Bootstrap 3](https://github.com/twbs/bootstrap)** framework. Highly customizable and easy to use. Fits many screen resolutions from small mobile devices to large desktops. Check out the live preview now and see for yourself. 5 | 6 | For more AdminLTE information visit [AdminLTE.IO](https://adminlte.io/) 7 | 8 | Installation 9 | ------------ 10 | 11 | - Fork the repository ([here is the guide](https://help.github.com/articles/fork-a-repo/)). 12 | - Clone to your machine 13 | - Install Angular 2 Client. 14 | ```bash 15 | npm install -g @angular/cli 16 | ``` 17 | - Clone the repository 18 | ```bash 19 | git clone https://github.com/YOUR_USERNAME/Angular2-AdminLTE.git 20 | ``` 21 | 22 | - Install the packages 23 | ```bash 24 | cd Angular2-AdminLTE 25 | npm install 26 | ``` 27 | 28 | Running the application 29 | ------------ 30 | - On the folder project 31 | ``` 32 | ng serve 33 | ``` 34 | - For starter page Navigate to [http://localhost:4200/](http://localhost:4200/) 35 | - For admin page Navigate to [http://localhost:4200/admin](http://localhost:4200/admin) 36 | 37 | Browser Support 38 | --------------- 39 | - IE 9+ 40 | - Firefox (latest) 41 | - Chrome (latest) 42 | - Safari (latest) 43 | - Opera (latest) 44 | 45 | Contribution 46 | ------------ 47 | Contribution are always **welcome and recommended**! Here is how: 48 | 49 | - Fork the repository ([here is the guide](https://help.github.com/articles/fork-a-repo/)). 50 | - Clone to your machine ```git clone https://github.com/YOUR_USERNAME/Angular2-AdminLTE.git``` 51 | - Make your changes 52 | - Create a pull request 53 | 54 | #### Contribution Requirements: 55 | - Contributions are only accepted through Github pull requests. 56 | - Finally, contributed code must work in all supported browsers (see above for browser support). 57 | 58 | License 59 | ------- 60 | Angular2-AdminLTE is an open source project by that is licensed under [MIT](http://opensource.org/licenses/MIT). 61 | 62 | Credits 63 | ------------- 64 | [AdminLTE.IO](https://adminlte.io/) 65 | 66 | -------------------------------------------------------------------------------- /web/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AngularAdminLTEPage } from './app.po'; 2 | 3 | describe('angular-admin-lte App', () => { 4 | let page: AngularAdminLTEPage; 5 | 6 | beforeEach(() => { 7 | page = new AngularAdminLTEPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to app!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /web/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AngularAdminLTEPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /web/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "baseUrl": "./", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": [ 9 | "jasmine", 10 | "jasminewd2", 11 | "node" 12 | ] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /web/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/0.13/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular/cli'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular/cli/plugins/karma') 14 | ], 15 | client:{ 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | reports: [ 'html', 'lcovonly' ], 20 | fixWebpackSourcePaths: true 21 | }, 22 | angularCli: { 23 | environment: 'dev' 24 | }, 25 | reporters: ['progress', 'kjhtml'], 26 | port: 9876, 27 | colors: true, 28 | logLevel: config.LOG_INFO, 29 | autoWatch: true, 30 | browsers: ['Chrome'], 31 | singleRun: false 32 | }); 33 | }; 34 | -------------------------------------------------------------------------------- /web/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-admin-lte", 3 | "version": "0.0.0", 4 | "license": "MIT", 5 | "scripts": { 6 | "ng": "ng", 7 | "start": "ng serve", 8 | "build": "ng build", 9 | "test": "ng test", 10 | "lint": "ng lint", 11 | "e2e": "ng e2e" 12 | }, 13 | "private": true, 14 | "dependencies": { 15 | "@angular/animations": "^4.4.3", 16 | "@angular/common": "^4.4.3", 17 | "@angular/compiler": "^4.4.3", 18 | "@angular/core": "^4.4.3", 19 | "@angular/forms": "^4.4.3", 20 | "@angular/http": "^4.4.3", 21 | "@angular/platform-browser": "^4.4.3", 22 | "@angular/platform-browser-dynamic": "^4.4.3", 23 | "@angular/platform-server": "^4.4.3", 24 | "@angular/router": "^4.4.3", 25 | "@types/bootstrap-datepicker": "0.0.9", 26 | "@types/bootstrap.v3.datetimepicker": "^4.17.41", 27 | "@types/daterangepicker": "^2.1.10", 28 | "@types/icheck": "^0.8.29", 29 | "@types/jquery-knob": "^1.2.29", 30 | "@types/jquery.slimscroll": "^1.3.31", 31 | "@types/jqueryui": "^1.11.35", 32 | "admin-lte": "2.3.11", 33 | "bootstrap": "^3.3.7", 34 | "bootstrap-datepicker": "^1.7.1", 35 | "bootstrap3-wysihtml5-bower": "^0.3.3", 36 | "core-js": "^2.4.1", 37 | "daterangepicker": "^2.1.25", 38 | "font-awesome": "^4.7.0", 39 | "icheck": "^1.0.2", 40 | "install": "^0.10.1", 41 | "ionicons": "^2.0.1", 42 | "jquery": "^2.2.3", 43 | "jquery-knob": "^1.2.11", 44 | "jquery-slimscroll": "^1.3.8", 45 | "jquery-sparkline": "^2.4.0", 46 | "jqueryui": "^1.11.1", 47 | "moment": "^2.18.1", 48 | "morris.js": "^0.5.0", 49 | "npm": "^5.3.0", 50 | "raphael": "^2.2.7", 51 | "rxjs": "^5.4.3", 52 | "zone.js": "^0.8.17" 53 | }, 54 | "devDependencies": { 55 | "@angular/cli": "^1.4.3", 56 | "@angular/compiler-cli": "^4.4.3", 57 | "@angular/language-service": "^4.4.3", 58 | "@types/jasmine": "~2.6.0", 59 | "@types/jasminewd2": "~2.0.2", 60 | "@types/jquery": "^2.0.47", 61 | "@types/morris.js": "^0.5.6", 62 | "@types/node": "~6.0.60", 63 | "codelyzer": "~3.2.0", 64 | "jasmine-core": "~2.8.0", 65 | "jasmine-spec-reporter": "~4.2.1", 66 | "karma": "~1.7.0", 67 | "karma-chrome-launcher": "~2.1.1", 68 | "karma-cli": "~1.0.1", 69 | "karma-coverage-istanbul-reporter": "^1.3.0", 70 | "karma-jasmine": "~1.1.0", 71 | "karma-jasmine-html-reporter": "^0.2.2", 72 | "protractor": "~5.1.2", 73 | "ts-node": "~3.3.0", 74 | "tslint": "~5.7.0", 75 | "typescript": "~2.3.3" 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /web/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './e2e/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: 'e2e/tsconfig.e2e.json' 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /web/src/_variables.less: -------------------------------------------------------------------------------- 1 | @import "../node_modules/admin-lte/build/less/AdminLTE"; 2 | @import "../node_modules/admin-lte/build/less/skins/_all-skins"; 3 | @boxed-layout-bg-image-path: "/assets/img/boxed-bg.jpg"; 4 | -------------------------------------------------------------------------------- /web/src/app/admin/admin-content/admin-content.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/app/admin/admin-content/admin-content.component.css -------------------------------------------------------------------------------- /web/src/app/admin/admin-content/admin-content.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AdminContentComponent } from './admin-content.component'; 4 | 5 | describe('AdminContentComponent', () => { 6 | let component: AdminContentComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ AdminContentComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(AdminContentComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should be created', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /web/src/app/admin/admin-content/admin-content.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-admin-content', 5 | templateUrl: './admin-content.component.html', 6 | styleUrls: ['./admin-content.component.css'] 7 | }) 8 | export class AdminContentComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /web/src/app/admin/admin-control-sidebar/admin-control-sidebar.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/app/admin/admin-control-sidebar/admin-control-sidebar.component.css -------------------------------------------------------------------------------- /web/src/app/admin/admin-control-sidebar/admin-control-sidebar.component.html: -------------------------------------------------------------------------------- 1 | 189 | 191 |
192 | -------------------------------------------------------------------------------- /web/src/app/admin/admin-control-sidebar/admin-control-sidebar.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AdminControlSidebarComponent } from './admin-control-sidebar.component'; 4 | 5 | describe('AdminControlSidebarComponent', () => { 6 | let component: AdminControlSidebarComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ AdminControlSidebarComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(AdminControlSidebarComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should be created', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /web/src/app/admin/admin-control-sidebar/admin-control-sidebar.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-admin-control-sidebar', 5 | templateUrl: './admin-control-sidebar.component.html', 6 | styleUrls: ['./admin-control-sidebar.component.css'] 7 | }) 8 | export class AdminControlSidebarComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /web/src/app/admin/admin-dashboard1/admin-dashboard1.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/app/admin/admin-dashboard1/admin-dashboard1.component.css -------------------------------------------------------------------------------- /web/src/app/admin/admin-dashboard1/admin-dashboard1.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AdminDashboard1Component } from './admin-dashboard1.component'; 4 | 5 | describe('AdminDashboard1Component', () => { 6 | let component: AdminDashboard1Component; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ AdminDashboard1Component ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(AdminDashboard1Component); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should be created', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /web/src/app/admin/admin-dashboard1/admin-dashboard1.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { } from 'jquery'; 3 | import { } from 'morris.js'; 4 | import { } from 'jquery-knob'; 5 | import { } from 'bootstrap-datepicker'; 6 | import { } from 'jqueryui'; 7 | import { } from 'daterangepicker'; 8 | import { } from 'jquery.slimscroll'; 9 | import * as moment from 'moment'; 10 | // Variable in assets/js/scripts.js file 11 | declare var AdminLTE: any; 12 | 13 | @Component({ 14 | selector: 'app-admin-dashboard1', 15 | templateUrl: './admin-dashboard1.component.html', 16 | styleUrls: ['./admin-dashboard1.component.css'] 17 | }) 18 | export class AdminDashboard1Component implements OnInit { 19 | linechart: morris.GridChart; 20 | areaChart: morris.GridChart; 21 | donutChart: morris.DonutChart; 22 | knob: JQuery; 23 | calendar: JQuery; 24 | 25 | constructor() { } 26 | ngOnInit() { 27 | // Update the AdminLTE layouts 28 | AdminLTE.init(); 29 | // Make the dashboard widgets sortable Using jquery UI 30 | jQuery('.connectedSortable').sortable({ 31 | placeholder: 'sort-highlight', 32 | connectWith: '.connectedSortable', 33 | handle: '.box-header, .nav-tabs', 34 | forcePlaceholderSize: true, 35 | zIndex: 999999 36 | }); 37 | jQuery('.connectedSortable .box-header, .connectedSortable .nav-tabs-custom').css('cursor', 'move'); 38 | 39 | // jQuery UI sortable for the todo list 40 | jQuery('.todo-list').sortable({ 41 | placeholder: 'sort-highlight', 42 | handle: '.handle', 43 | forcePlaceholderSize: true, 44 | zIndex: 999999 45 | }); 46 | 47 | // bootstrap WYSIHTML5 - text editor 48 | // jQuery('.textarea').wysihtml5(); 49 | 50 | jQuery('.daterange').daterangepicker({ 51 | ranges: { 52 | 'Today': [moment(), moment()], 53 | 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')], 54 | 'Last 7 Days': [moment().subtract(6, 'days'), moment()], 55 | 'Last 30 Days': [moment().subtract(29, 'days'), moment()], 56 | 'This Month': [moment().startOf('month'), moment().endOf('month')], 57 | 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')] 58 | }, 59 | startDate: moment().subtract(29, 'days'), 60 | endDate: moment() 61 | }, function (start, end) { 62 | // window.alert('You chose: ' + this.start.format('MMMM D, YYYY') + ' - ' + this.end.format('MMMM D, YYYY')); 63 | }); 64 | 65 | 66 | this.knob = jQuery('.knob').knob(); 67 | this.calendar = jQuery('#calendar').datepicker(); 68 | 69 | // SLIMSCROLL FOR CHAT WIDGET 70 | jQuery('#chat-box').slimScroll({ 71 | height: '250px' 72 | }); 73 | 74 | this.areaChart = Morris.Area({ 75 | element: 'revenue-chart', 76 | resize: true, 77 | data: [ 78 | { y: '2011 Q1', item1: 2666, item2: 2666 }, 79 | { y: '2011 Q2', item1: 2778, item2: 2294 }, 80 | { y: '2011 Q3', item1: 4912, item2: 1969 }, 81 | { y: '2011 Q4', item1: 3767, item2: 3597 }, 82 | { y: '2012 Q1', item1: 6810, item2: 1914 }, 83 | { y: '2012 Q2', item1: 5670, item2: 4293 }, 84 | { y: '2012 Q3', item1: 4820, item2: 3795 }, 85 | { y: '2012 Q4', item1: 15073, item2: 5967 }, 86 | { y: '2013 Q1', item1: 10687, item2: 4460 }, 87 | { y: '2013 Q2', item1: 8432, item2: 5713 } 88 | ], 89 | xkey: 'y', 90 | ykeys: ['item1', 'item2'], 91 | labels: ['Item 1', 'Item 2'], 92 | lineColors: ['#a0d0e0', '#3c8dbc'], 93 | hideHover: 'auto' 94 | }); 95 | 96 | this.donutChart = Morris.Donut({ 97 | element: 'sales-chart', 98 | resize: true, 99 | colors: ['#3c8dbc', '#f56954', '#00a65a'], 100 | data: [ 101 | { label: 'Download Sales', value: 12 }, 102 | { label: 'In-Store Sales', value: 30 }, 103 | { label: 'Mail-Order Sales', value: 20 } 104 | ], 105 | }); 106 | 107 | this.linechart = Morris.Line({ 108 | element: 'line-chart', 109 | resize: true, 110 | data: [ 111 | { y: '2011 Q1', item1: 2666 }, 112 | { y: '2011 Q2', item1: 2778 }, 113 | { y: '2011 Q3', item1: 4912 }, 114 | { y: '2011 Q4', item1: 3767 }, 115 | { y: '2012 Q1', item1: 6810 }, 116 | { y: '2012 Q2', item1: 5670 }, 117 | { y: '2012 Q3', item1: 4820 }, 118 | { y: '2012 Q4', item1: 15073 }, 119 | { y: '2013 Q1', item1: 10687 }, 120 | { y: '2013 Q2', item1: 8432 } 121 | ], 122 | xkey: 'y', 123 | ykeys: ['item1'], 124 | labels: ['Item 1'], 125 | lineColors: ['#efefef'], 126 | lineWidth: 2, 127 | hideHover: 'auto', 128 | gridTextColor: '#fff', 129 | gridStrokeWidth: 0.4, 130 | pointSize: 4, 131 | pointStrokeColors: ['#efefef'], 132 | gridLineColor: '#efefef', 133 | gridTextFamily: 'Open Sans', 134 | gridTextSize: 10 135 | }); 136 | 137 | /* The todo list plugin */ 138 | /* 139 | jQuery('.todo-list').todolist({ 140 | onCheck: function (ele) { 141 | window.console.log('The element has been checked'); 142 | return ele; 143 | }, 144 | onUncheck: function (ele) { 145 | window.console.log('The element has been unchecked'); 146 | return ele; 147 | } 148 | });*/ 149 | 150 | } 151 | 152 | } 153 | -------------------------------------------------------------------------------- /web/src/app/admin/admin-dashboard2/admin-dashboard2.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/app/admin/admin-dashboard2/admin-dashboard2.component.css -------------------------------------------------------------------------------- /web/src/app/admin/admin-dashboard2/admin-dashboard2.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AdminDashboard2Component } from './admin-dashboard2.component'; 4 | 5 | describe('AdminDashboard2Component', () => { 6 | let component: AdminDashboard2Component; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ AdminDashboard2Component ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(AdminDashboard2Component); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should be created', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /web/src/app/admin/admin-dashboard2/admin-dashboard2.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | // Variable in assets/js/scripts.js file 3 | declare var AdminLTE: any; 4 | 5 | @Component({ 6 | selector: 'app-admin-dashboard2', 7 | templateUrl: './admin-dashboard2.component.html', 8 | styleUrls: ['./admin-dashboard2.component.css'] 9 | }) 10 | export class AdminDashboard2Component implements OnInit { 11 | 12 | constructor() { } 13 | 14 | ngOnInit() { 15 | // Actualiza la barra latera y el footer 16 | AdminLTE.init(); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /web/src/app/admin/admin-footer/admin-footer.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/app/admin/admin-footer/admin-footer.component.css -------------------------------------------------------------------------------- /web/src/app/admin/admin-footer/admin-footer.component.html: -------------------------------------------------------------------------------- 1 |
2 | 5 | Copyright © 2014-2016 Almsaeed Studio. All rights reserved. 6 |
7 | -------------------------------------------------------------------------------- /web/src/app/admin/admin-footer/admin-footer.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AdminFooterComponent } from './admin-footer.component'; 4 | 5 | describe('AdminFooterComponent', () => { 6 | let component: AdminFooterComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ AdminFooterComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(AdminFooterComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should be created', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /web/src/app/admin/admin-footer/admin-footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-admin-footer', 5 | templateUrl: './admin-footer.component.html', 6 | styleUrls: ['./admin-footer.component.css'] 7 | }) 8 | export class AdminFooterComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /web/src/app/admin/admin-header/admin-header.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/app/admin/admin-header/admin-header.component.css -------------------------------------------------------------------------------- /web/src/app/admin/admin-header/admin-header.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AdminHeaderComponent } from './admin-header.component'; 4 | 5 | describe('AdminHeaderComponent', () => { 6 | let component: AdminHeaderComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ AdminHeaderComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(AdminHeaderComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should be created', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /web/src/app/admin/admin-header/admin-header.component.ts: -------------------------------------------------------------------------------- 1 | import { AuthService } from './../../auth/services/auth.service'; 2 | import { Component, OnInit } from '@angular/core'; 3 | 4 | @Component({ 5 | selector: 'app-admin-header', 6 | templateUrl: './admin-header.component.html', 7 | styleUrls: ['./admin-header.component.css'] 8 | }) 9 | export class AdminHeaderComponent implements OnInit { 10 | 11 | constructor(private auth: AuthService) { } 12 | 13 | ngOnInit() { 14 | } 15 | 16 | logout(e) { 17 | e.preventDefault(); 18 | this.auth.logout(); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /web/src/app/admin/admin-left-side/admin-left-side.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/app/admin/admin-left-side/admin-left-side.component.css -------------------------------------------------------------------------------- /web/src/app/admin/admin-left-side/admin-left-side.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AdminLeftSideComponent } from './admin-left-side.component'; 4 | 5 | describe('AdminLeftSideComponent', () => { 6 | let component: AdminLeftSideComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ AdminLeftSideComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(AdminLeftSideComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should be created', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /web/src/app/admin/admin-left-side/admin-left-side.component.ts: -------------------------------------------------------------------------------- 1 | import { AuthService } from './../../auth/services/auth.service'; 2 | import { Component, OnInit } from '@angular/core'; 3 | 4 | @Component({ 5 | selector: 'app-admin-left-side', 6 | templateUrl: './admin-left-side.component.html', 7 | styleUrls: ['./admin-left-side.component.css'] 8 | }) 9 | export class AdminLeftSideComponent implements OnInit { 10 | 11 | constructor(private auth: AuthService) { } 12 | 13 | ngOnInit() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /web/src/app/admin/admin-routing/admin-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule, Component } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { RouterModule } from '@angular/router'; 4 | 5 | import { AuthGuard } from './../../guards/auth.guard'; 6 | import { AdminComponent } from './../admin.component'; 7 | import { AdminDashboard1Component } from './../admin-dashboard1/admin-dashboard1.component'; 8 | import { AdminDashboard2Component } from './../admin-dashboard2/admin-dashboard2.component'; 9 | import { ProfileComponent } from './../../auth/profile/profile.component'; 10 | 11 | @NgModule({ 12 | imports: [ 13 | RouterModule.forChild([ 14 | { 15 | path: 'admin', 16 | component: AdminComponent, canActivate: [AuthGuard], canActivateChild: [AuthGuard], 17 | children: [ 18 | { 19 | path: '', 20 | redirectTo: 'dashboard1', 21 | pathMatch: 'full' 22 | }, 23 | { path: 'dashboard1', component: AdminDashboard1Component }, 24 | { path: 'dashboard2', component: AdminDashboard2Component }, 25 | { path: 'profile', component: ProfileComponent }, 26 | ] 27 | } 28 | ]) 29 | ], 30 | exports: [ 31 | RouterModule 32 | ] 33 | }) 34 | export class AdminRoutingModule { } 35 | -------------------------------------------------------------------------------- /web/src/app/admin/admin.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/app/admin/admin.component.css -------------------------------------------------------------------------------- /web/src/app/admin/admin.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | -------------------------------------------------------------------------------- /web/src/app/admin/admin.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AdminComponent } from './admin.component'; 4 | 5 | describe('AdminComponent', () => { 6 | let component: AdminComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ AdminComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(AdminComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should be created', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /web/src/app/admin/admin.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, OnDestroy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-admin', 5 | templateUrl: './admin.component.html', 6 | styleUrls: ['./admin.component.css'] 7 | }) 8 | export class AdminComponent implements OnInit, OnDestroy { 9 | 10 | bodyClasses = 'skin-blue sidebar-mini'; 11 | body: HTMLBodyElement = document.getElementsByTagName('body')[0]; 12 | 13 | constructor() { } 14 | 15 | ngOnInit() { 16 | // add the the body classes 17 | this.body.classList.add('skin-blue'); 18 | this.body.classList.add('sidebar-mini'); 19 | } 20 | 21 | ngOnDestroy() { 22 | // remove the the body classes 23 | this.body.classList.remove('skin-blue'); 24 | this.body.classList.remove('sidebar-mini'); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /web/src/app/admin/admin.module.ts: -------------------------------------------------------------------------------- 1 | import { AdminRoutingModule } from './admin-routing/admin-routing.module'; 2 | import { AdminDashboard1Component } from './admin-dashboard1/admin-dashboard1.component'; 3 | import { AdminControlSidebarComponent } from './admin-control-sidebar/admin-control-sidebar.component'; 4 | import { AdminFooterComponent } from './admin-footer/admin-footer.component'; 5 | import { AdminContentComponent } from './admin-content/admin-content.component'; 6 | import { AdminLeftSideComponent } from './admin-left-side/admin-left-side.component'; 7 | import { AdminHeaderComponent } from './admin-header/admin-header.component'; 8 | import { AdminComponent } from './admin.component'; 9 | import { NgModule } from '@angular/core'; 10 | import { CommonModule } from '@angular/common'; 11 | import { AdminDashboard2Component } from './admin-dashboard2/admin-dashboard2.component'; 12 | 13 | @NgModule({ 14 | imports: [ 15 | CommonModule, 16 | AdminRoutingModule 17 | ], 18 | declarations: [ 19 | AdminComponent, 20 | AdminHeaderComponent, 21 | AdminLeftSideComponent, 22 | AdminContentComponent, 23 | AdminFooterComponent, 24 | AdminControlSidebarComponent, 25 | AdminDashboard1Component, 26 | AdminDashboard2Component 27 | ], 28 | exports: [AdminComponent] 29 | }) 30 | export class AdminModule { } 31 | -------------------------------------------------------------------------------- /web/src/app/app-routing/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { RouterModule } from '@angular/router'; 4 | 5 | import { LoginComponent } from './../auth/login/login.component'; 6 | 7 | @NgModule({ 8 | imports: [ 9 | RouterModule.forRoot([ 10 | { path: '', redirectTo: 'admin', pathMatch: 'full' }, 11 | { path: 'auth/login', component: LoginComponent }, 12 | ]) 13 | ], 14 | declarations: [], 15 | exports: [ RouterModule] 16 | }) 17 | export class AppRoutingModule { } 18 | -------------------------------------------------------------------------------- /web/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/app/app.component.css -------------------------------------------------------------------------------- /web/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /web/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | 3 | import { AppComponent } from './app.component'; 4 | 5 | describe('AppComponent', () => { 6 | beforeEach(async(() => { 7 | TestBed.configureTestingModule({ 8 | declarations: [ 9 | AppComponent 10 | ], 11 | }).compileComponents(); 12 | })); 13 | 14 | it('should create the app', async(() => { 15 | const fixture = TestBed.createComponent(AppComponent); 16 | const app = fixture.debugElement.componentInstance; 17 | expect(app).toBeTruthy(); 18 | })); 19 | 20 | it(`should have as title 'app'`, async(() => { 21 | const fixture = TestBed.createComponent(AppComponent); 22 | const app = fixture.debugElement.componentInstance; 23 | expect(app.title).toEqual('app'); 24 | })); 25 | 26 | it('should render title in a h1 tag', async(() => { 27 | const fixture = TestBed.createComponent(AppComponent); 28 | fixture.detectChanges(); 29 | const compiled = fixture.debugElement.nativeElement; 30 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!'); 31 | })); 32 | }); 33 | -------------------------------------------------------------------------------- /web/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'app'; 10 | } 11 | -------------------------------------------------------------------------------- /web/src/app/app.error-handle.ts: -------------------------------------------------------------------------------- 1 | import { Router } from '@angular/router'; 2 | import { HttpErrorResponse } from '@angular/common/http'; 3 | import { Injectable, ErrorHandler, Injector } from '@angular/core'; 4 | 5 | @Injectable() 6 | export class AplicationErrorHandle extends ErrorHandler { 7 | 8 | constructor(private injector: Injector) { 9 | super(); 10 | } 11 | 12 | handleError(errorResponse: HttpErrorResponse | any) { 13 | if (errorResponse instanceof HttpErrorResponse) { 14 | const error = (typeof errorResponse.error !== 'object') ? JSON.parse(errorResponse.error) : errorResponse.error; 15 | 16 | if (errorResponse.status === 400 && 17 | (error.error === 'token_expired' || error.error === 'token_invalid' || 18 | error.error === 'A token is required' || error.error === 'token_not_provided')) { 19 | this.goToLogin(); 20 | } 21 | 22 | if (errorResponse.status === 401 && error.error === 'token_has_been_blacklisted') { 23 | this.goToLogin(); 24 | } 25 | 26 | } 27 | 28 | super.handleError(errorResponse); 29 | } 30 | 31 | goToLogin(): void { 32 | const router = this.injector.get(Router); 33 | router.navigate(['auth/login']); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /web/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule, ErrorHandler } from '@angular/core'; 3 | import { HTTP_INTERCEPTORS } from '@angular/common/http'; 4 | 5 | import { TokenInterceptor } from './interceptors/token.interceptor'; 6 | import { RefreshTokenInterceptor } from './interceptors/refresh-token.interceptor'; 7 | import { AplicationErrorHandle } from './app.error-handle'; 8 | import { AuthGuard } from './guards/auth.guard'; 9 | import { AppRoutingModule } from './app-routing/app-routing.module'; 10 | import { AdminModule } from './admin/admin.module'; 11 | import { AuthModule } from './auth/auth.module'; 12 | 13 | import { AppComponent } from './app.component'; 14 | 15 | @NgModule({ 16 | declarations: [ 17 | AppComponent, 18 | ], 19 | imports: [ 20 | BrowserModule, 21 | AppRoutingModule, 22 | AuthModule, 23 | AdminModule 24 | ], 25 | providers: [ 26 | AuthGuard, 27 | {provide: HTTP_INTERCEPTORS, useClass: TokenInterceptor, multi: true }, 28 | {provide: HTTP_INTERCEPTORS, useClass: RefreshTokenInterceptor, multi: true }, 29 | {provide: ErrorHandler, useClass: AplicationErrorHandle } 30 | ], 31 | bootstrap: [AppComponent] 32 | }) 33 | export class AppModule { } 34 | -------------------------------------------------------------------------------- /web/src/app/auth/auth.module.ts: -------------------------------------------------------------------------------- 1 | import { RouterModule } from '@angular/router'; 2 | import { NgModule } from '@angular/core'; 3 | import { CommonModule } from '@angular/common'; 4 | import { ReactiveFormsModule } from '@angular/forms'; 5 | import { HttpClientModule } from '@angular/common/http'; 6 | 7 | import { AuthService } from './services/auth.service'; 8 | import { LoginComponent } from './login/login.component'; 9 | import { ProfileComponent } from './profile/profile.component'; 10 | 11 | @NgModule({ 12 | imports: [ 13 | CommonModule, 14 | ReactiveFormsModule, 15 | HttpClientModule, 16 | RouterModule 17 | ], 18 | declarations: [ 19 | LoginComponent, 20 | ProfileComponent 21 | ], 22 | providers: [ 23 | AuthService 24 | ] 25 | }) 26 | export class AuthModule { } 27 | -------------------------------------------------------------------------------- /web/src/app/auth/interfaces/user.model.ts: -------------------------------------------------------------------------------- 1 | export interface User { 2 | id: number; 3 | name: string; 4 | email: string; 5 | created_at: string; 6 | updated_at: string; 7 | } 8 | -------------------------------------------------------------------------------- /web/src/app/auth/login/login.component.css: -------------------------------------------------------------------------------- 1 | .app-login .row{margin-top: 20vh;} 2 | .app-login .panel-body{box-shadow: 0px 0px 10px 3px #ccc} 3 | -------------------------------------------------------------------------------- /web/src/app/auth/login/login.component.html: -------------------------------------------------------------------------------- 1 | 40 | -------------------------------------------------------------------------------- /web/src/app/auth/login/login.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { FormGroup, FormBuilder, Validators } from '@angular/forms'; 3 | import { AuthService } from './../services/auth.service'; 4 | import { HttpErrorResponse } from '@angular/common/http'; 5 | import { Router } from '@angular/router'; 6 | 7 | @Component({ 8 | selector: 'app-login', 9 | templateUrl: './login.component.html', 10 | styleUrls: ['./login.component.css'] 11 | }) 12 | export class LoginComponent implements OnInit { 13 | 14 | f: FormGroup; 15 | errorCredentials = false; 16 | 17 | constructor(private formBuilder: FormBuilder, 18 | private authService: AuthService, 19 | private router: Router) { } 20 | 21 | ngOnInit() { 22 | this.f = this.formBuilder.group({ 23 | email: [null, [Validators.required, Validators.email]], 24 | password: [null, [Validators.required]] 25 | }); 26 | } 27 | 28 | onSubmit() { 29 | this.authService.login(this.f.value).subscribe( 30 | (resp) => { 31 | this.router.navigate(['admin']); 32 | }, 33 | (errorResponse: HttpErrorResponse) => { 34 | if (errorResponse.status === 401) { 35 | this.errorCredentials = true; 36 | } 37 | } 38 | ); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /web/src/app/auth/profile/profile.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/app/auth/profile/profile.component.css -------------------------------------------------------------------------------- /web/src/app/auth/profile/profile.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |

Profile

5 | 12 |
13 | 14 |
15 |
16 |
17 |
    18 |
  • 19 | Nome: {{user?.name}}
  • 20 |
  • 21 | E-mail: {{user?.email}}
  • 22 |
23 |
24 |
25 |
26 | 27 |
28 | -------------------------------------------------------------------------------- /web/src/app/auth/profile/profile.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { environment } from './../../../environments/environment'; 3 | import { HttpClient } from '@angular/common/http'; 4 | 5 | import { AuthService } from './../services/auth.service'; 6 | import { User } from './../interfaces/user.model'; 7 | 8 | @Component({ 9 | selector: 'app-profile', 10 | templateUrl: './profile.component.html', 11 | styleUrls: ['./profile.component.css'] 12 | }) 13 | export class ProfileComponent implements OnInit { 14 | 15 | user: User; 16 | 17 | constructor(private auth: AuthService, private http: HttpClient) { } 18 | 19 | ngOnInit() { 20 | this.http.get(`${environment.api_url}/auth/me`).subscribe(data => { 21 | this.user = data.user; 22 | }); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /web/src/app/auth/services/auth.service.ts: -------------------------------------------------------------------------------- 1 | import { Router } from '@angular/router'; 2 | import { Injectable } from '@angular/core'; 3 | import { HttpClient } from '@angular/common/http'; 4 | import { environment } from './../../../environments/environment'; 5 | import { Observable } from 'rxjs/Observable'; 6 | import 'rxjs/add/operator/do'; 7 | import 'rxjs/add/operator/toPromise'; 8 | 9 | import { User } from './../interfaces/user.model'; 10 | 11 | @Injectable() 12 | export class AuthService { 13 | 14 | constructor(private http: HttpClient, private router: Router) { } 15 | 16 | check(): boolean { 17 | return localStorage.getItem('user') ? true : false; 18 | } 19 | 20 | login(credentials: { email: string, password: string }): Observable { 21 | return this.http.post(`${environment.api_url}/auth/login`, credentials) 22 | .do(data => { 23 | localStorage.setItem('token', data.token); 24 | localStorage.setItem('user', btoa(JSON.stringify(data.user))); 25 | }); 26 | } 27 | 28 | logout(): void { 29 | this.http.get(`${environment.api_url}/auth/logout`).subscribe(resp => { 30 | console.log(resp); 31 | localStorage.clear(); 32 | this.router.navigate(['auth/login']); 33 | }); 34 | } 35 | 36 | getUser(): User { 37 | return localStorage.getItem('user') ? JSON.parse(atob(localStorage.getItem('user'))) : null; 38 | } 39 | 40 | setUser(): Promise { 41 | return this.http.get(`${environment.api_url}/auth/me`).toPromise() 42 | .then(data => { 43 | if (data.user) { 44 | localStorage.setItem('user', btoa(JSON.stringify(data.user))); 45 | return true; 46 | } 47 | return false; 48 | }); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /web/src/app/guards/auth.guard.ts: -------------------------------------------------------------------------------- 1 | import { Observable } from 'rxjs/Observable'; 2 | import { Injectable } from '@angular/core'; 3 | import { CanActivate, CanActivateChild, ActivatedRouteSnapshot, RouterStateSnapshot, Router } from '@angular/router'; 4 | import { AuthService } from '../auth/services/auth.service'; 5 | 6 | @Injectable() 7 | export class AuthGuard implements CanActivate, CanActivateChild { 8 | 9 | constructor(private auth: AuthService, private router: Router) { } 10 | 11 | canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable | Promise | boolean { 12 | if (this.auth.check()) { 13 | return true; 14 | } 15 | this.router.navigate(['auth/login']); 16 | return false; 17 | } 18 | 19 | canActivateChild(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable | Promise | boolean { 20 | if (this.auth.check()) { 21 | return true; 22 | } 23 | this.router.navigate(['auth/login']); 24 | return false; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /web/src/app/interceptors/refresh-token.interceptor.ts: -------------------------------------------------------------------------------- 1 | import { Injectable, Injector } from '@angular/core'; 2 | import { HttpEvent, HttpInterceptor, HttpHandler, HttpRequest, HttpErrorResponse, HttpClient } from '@angular/common/http'; 3 | import { environment } from './../../environments/environment'; 4 | import { Observable } from 'rxjs/Rx'; 5 | 6 | @Injectable() 7 | export class RefreshTokenInterceptor implements HttpInterceptor { 8 | 9 | constructor(private injector: Injector) {} 10 | 11 | intercept(request: HttpRequest, next: HttpHandler): Observable> { 12 | 13 | return next.handle(request).catch((errorResponse: HttpErrorResponse) => { 14 | const error = (typeof errorResponse.error !== 'object') ? JSON.parse(errorResponse.error) : errorResponse.error; 15 | 16 | if (errorResponse.status === 401 && error.error === 'token_expired') { 17 | const http = this.injector.get(HttpClient); 18 | 19 | return http.post(`${environment.api_url}/auth/refresh`, {}) 20 | .flatMap(data => { 21 | localStorage.setItem('token', data.token); 22 | const cloneRequest = request.clone({setHeaders: {'Authorization': `Bearer ${data.token}`}}); 23 | 24 | return next.handle(cloneRequest); 25 | }); 26 | } 27 | 28 | return Observable.throw(errorResponse); 29 | }); 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /web/src/app/interceptors/token.interceptor.ts: -------------------------------------------------------------------------------- 1 | import { Observable } from 'rxjs/Observable'; 2 | import { Injectable } from '@angular/core'; 3 | import { HttpEvent, HttpInterceptor, HttpHandler, HttpRequest } from '@angular/common/http'; 4 | import { environment } from './../../environments/environment'; 5 | 6 | @Injectable() 7 | export class TokenInterceptor implements HttpInterceptor { 8 | intercept(request: HttpRequest, next: HttpHandler): Observable> { 9 | const requestUrl: Array = request.url.split('/'); 10 | const apiUrl: Array = environment.api_url.split('/'); 11 | const token = localStorage.getItem('token'); 12 | 13 | if (token && (requestUrl[2] === apiUrl[2])) { 14 | const newRequest = request.clone({ setHeaders: {'Authorization': `Bearer ${token}`} }); 15 | return next.handle(newRequest); 16 | } else { 17 | return next.handle(request); 18 | } 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /web/src/app/starter/starter-content/starter-content.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/app/starter/starter-content/starter-content.component.css -------------------------------------------------------------------------------- /web/src/app/starter/starter-content/starter-content.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |

5 | Page Header 6 | Optional description 7 |

8 | 12 |
13 | 14 | 15 |
16 | 17 | 18 | 19 |
20 | 21 |
22 | -------------------------------------------------------------------------------- /web/src/app/starter/starter-content/starter-content.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { StarterContentComponent } from './starter-content.component'; 4 | 5 | describe('StarterContentComponent', () => { 6 | let component: StarterContentComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ StarterContentComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(StarterContentComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should be created', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /web/src/app/starter/starter-content/starter-content.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | // Variable in assets/js/scripts.js file 3 | declare var AdminLTE: any; 4 | 5 | @Component({ 6 | selector: 'app-starter-content', 7 | templateUrl: './starter-content.component.html', 8 | styleUrls: ['./starter-content.component.css'] 9 | }) 10 | export class StarterContentComponent implements OnInit { 11 | 12 | constructor() { } 13 | 14 | ngOnInit() { 15 | // Update the AdminLTE layouts 16 | AdminLTE.init(); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /web/src/app/starter/starter-control-sidebar/starter-control-sidebar.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/app/starter/starter-control-sidebar/starter-control-sidebar.component.css -------------------------------------------------------------------------------- /web/src/app/starter/starter-control-sidebar/starter-control-sidebar.component.html: -------------------------------------------------------------------------------- 1 | 72 | -------------------------------------------------------------------------------- /web/src/app/starter/starter-control-sidebar/starter-control-sidebar.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { StarterControlSidebarComponent } from './starter-control-sidebar.component'; 4 | 5 | describe('StarterControlSidebarComponent', () => { 6 | let component: StarterControlSidebarComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ StarterControlSidebarComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(StarterControlSidebarComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should be created', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /web/src/app/starter/starter-control-sidebar/starter-control-sidebar.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-starter-control-sidebar', 5 | templateUrl: './starter-control-sidebar.component.html', 6 | styleUrls: ['./starter-control-sidebar.component.css'] 7 | }) 8 | export class StarterControlSidebarComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /web/src/app/starter/starter-footer/starter-footer.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/app/starter/starter-footer/starter-footer.component.css -------------------------------------------------------------------------------- /web/src/app/starter/starter-footer/starter-footer.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 6 | 7 | Copyright © 2016 Company. All rights reserved. 8 |
9 | -------------------------------------------------------------------------------- /web/src/app/starter/starter-footer/starter-footer.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { StarterFooterComponent } from './starter-footer.component'; 4 | 5 | describe('StarterFooterComponent', () => { 6 | let component: StarterFooterComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ StarterFooterComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(StarterFooterComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should be created', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /web/src/app/starter/starter-footer/starter-footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-starter-footer', 5 | templateUrl: './starter-footer.component.html', 6 | styleUrls: ['./starter-footer.component.css'] 7 | }) 8 | export class StarterFooterComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /web/src/app/starter/starter-header/starter-header.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/app/starter/starter-header/starter-header.component.css -------------------------------------------------------------------------------- /web/src/app/starter/starter-header/starter-header.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 10 | 11 | 12 | 170 |
171 | -------------------------------------------------------------------------------- /web/src/app/starter/starter-header/starter-header.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { StarterHeaderComponent } from './starter-header.component'; 4 | 5 | describe('StarterHeaderComponent', () => { 6 | let component: StarterHeaderComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ StarterHeaderComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(StarterHeaderComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should be created', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /web/src/app/starter/starter-header/starter-header.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-starter-header', 5 | templateUrl: './starter-header.component.html', 6 | styleUrls: ['./starter-header.component.css'] 7 | }) 8 | export class StarterHeaderComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /web/src/app/starter/starter-left-side/starter-left-side.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/app/starter/starter-left-side/starter-left-side.component.css -------------------------------------------------------------------------------- /web/src/app/starter/starter-left-side/starter-left-side.component.html: -------------------------------------------------------------------------------- 1 | 52 | -------------------------------------------------------------------------------- /web/src/app/starter/starter-left-side/starter-left-side.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { StarterLeftSideComponent } from './starter-left-side.component'; 4 | 5 | describe('StarterLeftSideComponent', () => { 6 | let component: StarterLeftSideComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ StarterLeftSideComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(StarterLeftSideComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should be created', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /web/src/app/starter/starter-left-side/starter-left-side.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-starter-left-side', 5 | templateUrl: './starter-left-side.component.html', 6 | styleUrls: ['./starter-left-side.component.css'] 7 | }) 8 | export class StarterLeftSideComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /web/src/app/starter/starter.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/app/starter/starter.component.css -------------------------------------------------------------------------------- /web/src/app/starter/starter.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 16 |
17 |
18 | -------------------------------------------------------------------------------- /web/src/app/starter/starter.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { StarterComponent } from './starter.component'; 4 | 5 | describe('StarterComponent', () => { 6 | let component: StarterComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ StarterComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(StarterComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should be created', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /web/src/app/starter/starter.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, OnDestroy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-starter', 5 | templateUrl: './starter.component.html', 6 | styleUrls: ['./starter.component.css'] 7 | }) 8 | export class StarterComponent implements OnInit, OnDestroy { 9 | 10 | bodyClasses = 'skin-blue sidebar-mini'; 11 | body: HTMLBodyElement = document.getElementsByTagName('body')[0]; 12 | 13 | constructor() { } 14 | 15 | ngOnInit() { 16 | // add the the body classes 17 | this.body.classList.add('skin-blue'); 18 | this.body.classList.add('sidebar-mini'); 19 | } 20 | 21 | ngOnDestroy() { 22 | // remove the the body classes 23 | this.body.classList.remove('skin-blue'); 24 | this.body.classList.remove('sidebar-mini'); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /web/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/assets/.gitkeep -------------------------------------------------------------------------------- /web/src/assets/admin.less: -------------------------------------------------------------------------------- 1 | @import "../../node_modules/admin-lte/build/less/AdminLTE"; 2 | @import "../../node_modules/admin-lte/build/less/skins/_all-skins"; 3 | @boxed-layout-bg-image-path: "/assets/img/boxed-bg.jpg"; 4 | -------------------------------------------------------------------------------- /web/src/assets/img/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/assets/img/avatar.png -------------------------------------------------------------------------------- /web/src/assets/img/avatar04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/assets/img/avatar04.png -------------------------------------------------------------------------------- /web/src/assets/img/avatar2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/assets/img/avatar2.png -------------------------------------------------------------------------------- /web/src/assets/img/avatar3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/assets/img/avatar3.png -------------------------------------------------------------------------------- /web/src/assets/img/avatar5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/assets/img/avatar5.png -------------------------------------------------------------------------------- /web/src/assets/img/boxed-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/assets/img/boxed-bg.jpg -------------------------------------------------------------------------------- /web/src/assets/img/boxed-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/assets/img/boxed-bg.png -------------------------------------------------------------------------------- /web/src/assets/img/credit/american-express.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/assets/img/credit/american-express.png -------------------------------------------------------------------------------- /web/src/assets/img/credit/cirrus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/assets/img/credit/cirrus.png -------------------------------------------------------------------------------- /web/src/assets/img/credit/mastercard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/assets/img/credit/mastercard.png -------------------------------------------------------------------------------- /web/src/assets/img/credit/mestro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/assets/img/credit/mestro.png -------------------------------------------------------------------------------- /web/src/assets/img/credit/paypal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/assets/img/credit/paypal.png -------------------------------------------------------------------------------- /web/src/assets/img/credit/paypal2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/assets/img/credit/paypal2.png -------------------------------------------------------------------------------- /web/src/assets/img/credit/visa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/assets/img/credit/visa.png -------------------------------------------------------------------------------- /web/src/assets/img/default-50x50.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/assets/img/default-50x50.gif -------------------------------------------------------------------------------- /web/src/assets/img/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/assets/img/icons.png -------------------------------------------------------------------------------- /web/src/assets/img/photo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/assets/img/photo1.png -------------------------------------------------------------------------------- /web/src/assets/img/photo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/assets/img/photo2.png -------------------------------------------------------------------------------- /web/src/assets/img/photo3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/assets/img/photo3.jpg -------------------------------------------------------------------------------- /web/src/assets/img/photo4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/assets/img/photo4.jpg -------------------------------------------------------------------------------- /web/src/assets/img/user1-128x128.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/assets/img/user1-128x128.jpg -------------------------------------------------------------------------------- /web/src/assets/img/user2-160x160.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/assets/img/user2-160x160.jpg -------------------------------------------------------------------------------- /web/src/assets/img/user3-128x128.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/assets/img/user3-128x128.jpg -------------------------------------------------------------------------------- /web/src/assets/img/user4-128x128.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/assets/img/user4-128x128.jpg -------------------------------------------------------------------------------- /web/src/assets/img/user5-128x128.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/assets/img/user5-128x128.jpg -------------------------------------------------------------------------------- /web/src/assets/img/user6-128x128.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/assets/img/user6-128x128.jpg -------------------------------------------------------------------------------- /web/src/assets/img/user7-128x128.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/assets/img/user7-128x128.jpg -------------------------------------------------------------------------------- /web/src/assets/img/user8-128x128.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/assets/img/user8-128x128.jpg -------------------------------------------------------------------------------- /web/src/assets/js/scripts.js: -------------------------------------------------------------------------------- 1 | $.widget.bridge('uibutton', $.ui.button); 2 | 3 | //receive calls from typescript code to update the layouts 4 | var AdminLTE = (function() { 5 | return { 6 | init: function() { 7 | $(function(){ 8 | $.AdminLTE.layout.activate(); 9 | $.AdminLTE.layout.fix(); 10 | $.AdminLTE.layout.fixSidebar(); 11 | }); 12 | } 13 | } 14 | })(AdminLTE||{}); 15 | 16 | -------------------------------------------------------------------------------- /web/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | api_url: 'http://localhost:8000/api' 4 | }; 5 | -------------------------------------------------------------------------------- /web/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `.angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false, 8 | api_url: 'http://localhost:8000/api' 9 | }; 10 | -------------------------------------------------------------------------------- /web/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tjgweb/curso-laravel-jwt-angular/559ed0dedab72aad093fcc23d1eb0274ef9b8e79/web/src/favicon.ico -------------------------------------------------------------------------------- /web/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Angular AdminLTE 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | Loading ... 15 | 16 | 17 | -------------------------------------------------------------------------------- /web/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule); 12 | -------------------------------------------------------------------------------- /web/src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/ 22 | // import 'core-js/es6/symbol'; 23 | // import 'core-js/es6/object'; 24 | // import 'core-js/es6/function'; 25 | // import 'core-js/es6/parse-int'; 26 | // import 'core-js/es6/parse-float'; 27 | // import 'core-js/es6/number'; 28 | // import 'core-js/es6/math'; 29 | // import 'core-js/es6/string'; 30 | // import 'core-js/es6/date'; 31 | // import 'core-js/es6/array'; 32 | // import 'core-js/es6/regexp'; 33 | // import 'core-js/es6/map'; 34 | // import 'core-js/es6/weak-map'; 35 | // import 'core-js/es6/set'; 36 | 37 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 38 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 39 | 40 | /** Evergreen browsers require these. **/ 41 | import 'core-js/es6/reflect'; 42 | import 'core-js/es7/reflect'; 43 | 44 | 45 | /** 46 | * Required to support Web Animations `@angular/animation`. 47 | * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation 48 | **/ 49 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 50 | 51 | 52 | 53 | /*************************************************************************************************** 54 | * Zone JS is required by Angular itself. 55 | */ 56 | import 'zone.js/dist/zone'; // Included with Angular CLI. 57 | 58 | 59 | 60 | /*************************************************************************************************** 61 | * APPLICATION IMPORTS 62 | */ 63 | 64 | /** 65 | * Date, currency, decimal and percent pipes. 66 | * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 67 | */ 68 | // import 'intl'; // Run `npm install --save intl`. 69 | /** 70 | * Need to import at least one locale-data with intl. 71 | */ 72 | // import 'intl/locale-data/jsonp/en'; 73 | -------------------------------------------------------------------------------- /web/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /web/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/long-stack-trace-zone'; 4 | import 'zone.js/dist/proxy.js'; 5 | import 'zone.js/dist/sync-test'; 6 | import 'zone.js/dist/jasmine-patch'; 7 | import 'zone.js/dist/async-test'; 8 | import 'zone.js/dist/fake-async-test'; 9 | import { getTestBed } from '@angular/core/testing'; 10 | import { 11 | BrowserDynamicTestingModule, 12 | platformBrowserDynamicTesting 13 | } from '@angular/platform-browser-dynamic/testing'; 14 | 15 | // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. 16 | declare const __karma__: any; 17 | declare const require: any; 18 | 19 | // Prevent Karma from running prematurely. 20 | __karma__.loaded = function () {}; 21 | 22 | // First, initialize the Angular testing environment. 23 | getTestBed().initTestEnvironment( 24 | BrowserDynamicTestingModule, 25 | platformBrowserDynamicTesting() 26 | ); 27 | // Then we find all the tests. 28 | const context = require.context('./', true, /\.spec\.ts$/); 29 | // And load the modules. 30 | context.keys().map(context); 31 | // Finally, start Karma to run the tests. 32 | __karma__.start(); 33 | -------------------------------------------------------------------------------- /web/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "baseUrl": "./", 6 | "module": "es2015", 7 | "types": [] 8 | }, 9 | "exclude": [ 10 | "test.ts", 11 | "**/*.spec.ts" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /web/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "baseUrl": "./", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": [ 9 | "jasmine", 10 | "node" 11 | ] 12 | }, 13 | "files": [ 14 | "test.ts" 15 | ], 16 | "include": [ 17 | "**/*.spec.ts", 18 | "**/*.d.ts" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /web/src/typings.d.ts: -------------------------------------------------------------------------------- 1 | /* SystemJS module definition */ 2 | declare var module: NodeModule; 3 | interface NodeModule { 4 | id: string; 5 | } 6 | -------------------------------------------------------------------------------- /web/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "outDir": "./dist/out-tsc", 5 | "sourceMap": true, 6 | "declaration": false, 7 | "moduleResolution": "node", 8 | "emitDecoratorMetadata": true, 9 | "experimentalDecorators": true, 10 | "target": "es5", 11 | "typeRoots": [ 12 | "node_modules/@types", 13 | "../node_modules/moment" 14 | ], 15 | "lib": [ 16 | "es2016", 17 | "dom" 18 | ] 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /web/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "node_modules/codelyzer" 4 | ], 5 | "rules": { 6 | "arrow-return-shorthand": true, 7 | "callable-types": true, 8 | "class-name": true, 9 | "comment-format": [ 10 | true, 11 | "check-space" 12 | ], 13 | "curly": true, 14 | "eofline": true, 15 | "forin": true, 16 | "import-blacklist": [ 17 | true, 18 | "rxjs" 19 | ], 20 | "import-spacing": true, 21 | "indent": [ 22 | true, 23 | "spaces" 24 | ], 25 | "interface-over-type-literal": true, 26 | "label-position": true, 27 | "max-line-length": [ 28 | true, 29 | 140 30 | ], 31 | "member-access": false, 32 | "member-ordering": [ 33 | true, 34 | { 35 | "order": [ 36 | "static-field", 37 | "instance-field", 38 | "static-method", 39 | "instance-method" 40 | ] 41 | } 42 | ], 43 | "no-arg": true, 44 | "no-bitwise": true, 45 | "no-console": [ 46 | true, 47 | "debug", 48 | "info", 49 | "time", 50 | "timeEnd", 51 | "trace" 52 | ], 53 | "no-construct": true, 54 | "no-debugger": true, 55 | "no-duplicate-super": true, 56 | "no-empty": false, 57 | "no-empty-interface": true, 58 | "no-eval": true, 59 | "no-inferrable-types": [ 60 | true, 61 | "ignore-params" 62 | ], 63 | "no-misused-new": true, 64 | "no-non-null-assertion": true, 65 | "no-shadowed-variable": true, 66 | "no-string-literal": false, 67 | "no-string-throw": true, 68 | "no-switch-case-fall-through": true, 69 | "no-trailing-whitespace": true, 70 | "no-unnecessary-initializer": true, 71 | "no-unused-expression": true, 72 | "no-use-before-declare": true, 73 | "no-var-keyword": true, 74 | "object-literal-sort-keys": false, 75 | "one-line": [ 76 | true, 77 | "check-open-brace", 78 | "check-catch", 79 | "check-else", 80 | "check-whitespace" 81 | ], 82 | "prefer-const": true, 83 | "quotemark": [ 84 | true, 85 | "single" 86 | ], 87 | "radix": true, 88 | "semicolon": [ 89 | true, 90 | "always" 91 | ], 92 | "triple-equals": [ 93 | true, 94 | "allow-null-check" 95 | ], 96 | "typedef-whitespace": [ 97 | true, 98 | { 99 | "call-signature": "nospace", 100 | "index-signature": "nospace", 101 | "parameter": "nospace", 102 | "property-declaration": "nospace", 103 | "variable-declaration": "nospace" 104 | } 105 | ], 106 | "typeof-compare": true, 107 | "unified-signatures": true, 108 | "variable-name": false, 109 | "whitespace": [ 110 | true, 111 | "check-branch", 112 | "check-decl", 113 | "check-operator", 114 | "check-separator", 115 | "check-type" 116 | ], 117 | "directive-selector": [ 118 | true, 119 | "attribute", 120 | "app", 121 | "camelCase" 122 | ], 123 | "component-selector": [ 124 | true, 125 | "element", 126 | "app", 127 | "kebab-case" 128 | ], 129 | "use-input-property-decorator": true, 130 | "use-output-property-decorator": true, 131 | "use-host-property-decorator": true, 132 | "no-input-rename": true, 133 | "no-output-rename": true, 134 | "use-life-cycle-interface": true, 135 | "use-pipe-transform-interface": true, 136 | "component-class-suffix": true, 137 | "directive-class-suffix": true, 138 | "no-access-missing-member": true, 139 | "templates-use-public": true, 140 | "invoke-injectable": true 141 | } 142 | } 143 | --------------------------------------------------------------------------------