├── .env.example ├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md ├── angular ├── app1 │ ├── .angular-cli.json │ ├── .editorconfig │ ├── .gitignore │ ├── README.md │ ├── base.config.js │ ├── dev.config.js │ ├── e2e │ │ ├── app.e2e-spec.ts │ │ ├── app.po.ngsummary.json │ │ ├── app.po.ts │ │ └── tsconfig.e2e.json │ ├── karma.conf.js │ ├── out.txt │ ├── package-lock.json │ ├── package.json │ ├── prod.config.js │ ├── protractor.conf.js │ ├── src │ │ ├── app │ │ │ ├── app-routing │ │ │ │ ├── app-routing.module.ts │ │ │ │ └── test-routing │ │ │ │ │ ├── test-routing.component.css │ │ │ │ │ ├── test-routing.component.html │ │ │ │ │ ├── test-routing.component.spec.ts │ │ │ │ │ └── test-routing.component.ts │ │ │ ├── app.component.html │ │ │ ├── app.component.spec.ts │ │ │ ├── app.component.ts │ │ │ ├── app.module.ts │ │ │ ├── lazyload-example │ │ │ │ ├── lazyload-example.module.ts │ │ │ │ ├── lazyload-routing │ │ │ │ │ └── lazyload-routing.module.ts │ │ │ │ └── lazyload-test │ │ │ │ │ ├── lazyload-test.component.spec.ts │ │ │ │ │ └── lazyload-test.component.ts │ │ │ ├── motivations │ │ │ │ ├── motivations.component.spec.ts │ │ │ │ └── motivations.component.ts │ │ │ └── routing-test │ │ │ │ ├── lazyload-routes │ │ │ │ ├── lazyload-routes.module.ts │ │ │ │ └── test-lazy-route │ │ │ │ │ ├── test-lazy-route.component.css │ │ │ │ │ ├── test-lazy-route.component.html │ │ │ │ │ ├── test-lazy-route.component.spec.ts │ │ │ │ │ └── test-lazy-route.component.ts │ │ │ │ └── routing-test.module.ts │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── css │ │ │ └── styles.css │ │ ├── environments │ │ │ ├── environment.ngsummary.json │ │ │ ├── environment.prod.ngsummary.json │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── laravel-ng-template.html │ │ ├── main.ts │ │ ├── polyfills.ts │ │ ├── styles.css │ │ ├── test.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.spec.json │ │ └── typings.d.ts │ ├── tsconfig.json │ └── tslint.json ├── app2 │ ├── .angular-cli.json │ ├── .editorconfig │ ├── .gitignore │ ├── README.md │ ├── base.config.js │ ├── dev.config.js │ ├── e2e │ │ ├── app.e2e-spec.ts │ │ ├── app.po.ts │ │ └── tsconfig.e2e.json │ ├── karma.conf.js │ ├── package-lock.json │ ├── package.json │ ├── prod.config.js │ ├── protractor.conf.js │ ├── src │ │ ├── app │ │ │ ├── app-routing │ │ │ │ ├── app-routing.module.ts │ │ │ │ └── test-routing │ │ │ │ │ ├── test-routing.component.css │ │ │ │ │ ├── test-routing.component.html │ │ │ │ │ ├── test-routing.component.spec.ts │ │ │ │ │ └── test-routing.component.ts │ │ │ ├── app.component.html │ │ │ ├── app.component.spec.ts │ │ │ ├── app.component.ts │ │ │ ├── app.module.ts │ │ │ ├── lazyload-example │ │ │ │ ├── lazyload-example.module.ts │ │ │ │ ├── lazyload-routing │ │ │ │ │ └── lazyload-routing.module.ts │ │ │ │ └── lazyload-test │ │ │ │ │ ├── lazyload-test.component.spec.ts │ │ │ │ │ └── lazyload-test.component.ts │ │ │ ├── motivations │ │ │ │ ├── motivations.component.spec.ts │ │ │ │ └── motivations.component.ts │ │ │ └── routing-test │ │ │ │ ├── lazyload-routes │ │ │ │ └── lazyload-routes.module.ts │ │ │ │ ├── routing-test.module.ts │ │ │ │ └── test-lazy-route │ │ │ │ ├── test-lazy-route.component.css │ │ │ │ ├── test-lazy-route.component.html │ │ │ │ ├── test-lazy-route.component.spec.ts │ │ │ │ └── test-lazy-route.component.ts │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── css │ │ │ └── styles.css │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── laravel-ng-template.html │ │ ├── main.ts │ │ ├── polyfills.ts │ │ ├── styles.css │ │ ├── test.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.spec.json │ │ └── typings.d.ts │ ├── tsconfig.json │ └── tslint.json └── webpack_config │ ├── base │ └── base.config.js │ ├── dev │ └── dev.config.js │ └── prod │ └── prod.config.js ├── app ├── Console │ └── Kernel.php ├── Exceptions │ └── Handler.php ├── Http │ ├── Controllers │ │ ├── Auth │ │ │ ├── ForgotPasswordController.php │ │ │ ├── LoginController.php │ │ │ ├── RegisterController.php │ │ │ └── ResetPasswordController.php │ │ └── Controller.php │ ├── Kernel.php │ └── Middleware │ │ ├── EncryptCookies.php │ │ ├── RedirectIfAuthenticated.php │ │ ├── TrimStrings.php │ │ └── VerifyCsrfToken.php ├── Providers │ ├── AppServiceProvider.php │ ├── AuthServiceProvider.php │ ├── BroadcastServiceProvider.php │ ├── EventServiceProvider.php │ └── RouteServiceProvider.php └── User.php ├── artisan ├── bootstrap ├── app.php ├── autoload.php └── cache │ └── .gitignore ├── composer.json ├── composer.lock ├── config ├── app.php ├── auth.php ├── broadcasting.php ├── cache.php ├── database.php ├── filesystems.php ├── mail.php ├── queue.php ├── services.php ├── session.php └── view.php ├── database ├── .gitignore ├── factories │ └── ModelFactory.php ├── migrations │ ├── 2014_10_12_000000_create_users_table.php │ └── 2014_10_12_100000_create_password_resets_table.php └── seeds │ └── DatabaseSeeder.php ├── docs ├── angular │ ├── another_app.md │ └── integration.md └── images │ ├── angular.png │ └── laravel.png ├── package-lock.json ├── package.json ├── phpunit.xml ├── public ├── .htaccess ├── css │ └── app.css ├── favicon.ico ├── fonts │ └── vendor │ │ └── bootstrap-sass │ │ └── bootstrap │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 ├── index.php ├── js │ └── app.js ├── mix-manifest.json └── robots.txt ├── 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 └── yarn.lock /.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 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.css linguist-vendored 3 | *.scss linguist-vendored 4 | *.js linguist-vendored 5 | CHANGELOG.md export-ignore 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /public/hot 3 | /public/storage 4 | /public/app1 5 | /public/app2 6 | /storage/*.key 7 | /vendor 8 | /.idea 9 | /.vagrant 10 | Homestead.json 11 | Homestead.yaml 12 | npm-debug.log 13 | .env 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Toni Romic (toni.rmc@gmail.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Laravel - Angular Integration 2 | ![Laravel](https://github.com/toni-rmc/laravel-angular-integration/blob/master/docs/images/laravel.png) ![Angular](https://github.com/toni-rmc/laravel-angular-integration/blob/master/docs/images/angular.png) 3 | 4 | This project provides tools and shows you an easy way to integrate one or more Angular apps into your Laravel project. 5 | 6 | ## Getting Started 7 | 8 | After you clone the code you have to build the apps by running necessary commands, than you can test from the default Laravel welcome page. 9 | You will see links that will take you to the separate integrated Angular apps. 10 | 11 | Two links will take you to the separate Angular bundled apps made using **angular-cli**. 12 | 13 | All Angular apps live in `angular` directory in Laravel project root directory and they are bundled and distributed to `public` directory after build. 14 | 15 | ## Setting Up 16 | 17 | Clone code, **cd** to project directory and use composer to install all the dependencies. 18 | 19 | ``` 20 | cd 21 | composer install 22 | npm install 23 | ``` 24 | 25 | Follow the link below to get detailed explanation on how to integrate Angular programs into Laravel environment. 26 | 27 | + [Laravel - Angular integration](docs/angular/integration.md) 28 | 29 | ## Note 30 | 31 | This project no longer supports SistemJS build as it is outdated by now. Developing Angular projects without using **angular-cli** tool doesn't make much sense that is why this project now only focuses on integrating Angular programs made with **angular-cli** into Laravel. 32 | 33 | ## License 34 | 35 | MIT 36 | 37 | -------------------------------------------------------------------------------- /angular/app1/.angular-cli.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "project": { 4 | "name": "app1", 5 | "ejected": false 6 | }, 7 | "apps": [ 8 | { 9 | "root": "src", 10 | "outDir": "dist", 11 | "assets": [ 12 | "assets", 13 | "favicon.ico" 14 | ], 15 | "index": "index.html", 16 | "main": "main.ts", 17 | "polyfills": "polyfills.ts", 18 | "test": "test.ts", 19 | "tsconfig": "tsconfig.app.json", 20 | "testTsconfig": "tsconfig.spec.json", 21 | "prefix": "app", 22 | "styles": [ 23 | "styles.css", 24 | "css/styles.css" 25 | ], 26 | "scripts": [], 27 | "environmentSource": "environments/environment.ts", 28 | "environments": { 29 | "dev": "environments/environment.ts", 30 | "prod": "environments/environment.prod.ts" 31 | } 32 | } 33 | ], 34 | "e2e": { 35 | "protractor": { 36 | "config": "./protractor.conf.js" 37 | } 38 | }, 39 | "lint": [ 40 | { 41 | "project": "src/tsconfig.app.json", 42 | "exclude": "**/node_modules/**" 43 | }, 44 | { 45 | "project": "src/tsconfig.spec.json", 46 | "exclude": "**/node_modules/**" 47 | }, 48 | { 49 | "project": "e2e/tsconfig.e2e.json", 50 | "exclude": "**/node_modules/**" 51 | } 52 | ], 53 | "test": { 54 | "karma": { 55 | "config": "./karma.conf.js" 56 | } 57 | }, 58 | "defaults": { 59 | "styleExt": "css", 60 | "component": { 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /angular/app1/.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 | -------------------------------------------------------------------------------- /angular/app1/.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 | yarn-error.log 36 | 37 | # e2e 38 | /e2e/*.js 39 | /e2e/*.map 40 | 41 | # System Files 42 | .DS_Store 43 | Thumbs.db 44 | -------------------------------------------------------------------------------- /angular/app1/README.md: -------------------------------------------------------------------------------- 1 | # App1 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.3.2. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 24 | Before running the tests make sure you are serving the app via `ng serve`. 25 | 26 | ## Further help 27 | 28 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 29 | -------------------------------------------------------------------------------- /angular/app1/base.config.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | const CopyWebpackPlugin = require('copy-webpack-plugin'); 4 | const ProgressPlugin = require('webpack/lib/ProgressPlugin'); 5 | const CircularDependencyPlugin = require('circular-dependency-plugin'); 6 | const rxPaths = require('rxjs/_esm5/path-mapping'); 7 | 8 | const { NoEmitOnErrorsPlugin } = require('webpack'); 9 | const { BaseHrefWebpackPlugin } = require('@angular/cli/plugins/webpack'); 10 | const { CommonsChunkPlugin } = require('webpack').optimize; 11 | 12 | const nodeModules = path.join(process.cwd(), 'node_modules'); 13 | const realNodeModules = fs.realpathSync(nodeModules); 14 | const genDirNodeModules = path.join(process.cwd(), 'src', '$$_gendir', 'node_modules'); 15 | 16 | const projectRoot = process.cwd(); 17 | 18 | module.exports = { 19 | "resolve": { 20 | "extensions": [ 21 | ".ts", 22 | ".js" 23 | ], 24 | "symlinks": true, 25 | "modules": [ 26 | "./src", 27 | "./node_modules" 28 | ] 29 | }, 30 | "resolveLoader": { 31 | "modules": [ 32 | "./node_modules" 33 | ], 34 | "alias": rxPaths() 35 | }, 36 | "module": { 37 | "rules": [ 38 | { 39 | "test": /\.html$/, 40 | "loader": "raw-loader" 41 | }, 42 | { 43 | "test": /\.(eot|svg|cur)$/, 44 | "loader": "file-loader", 45 | "options": { 46 | "name": "[name].[hash:20].[ext]", 47 | "limit": 10000 48 | } 49 | }, 50 | { 51 | "test": /\.(jpg|png|webp|gif|otf|ttf|woff|woff2|ani)$/, 52 | "loader": "url-loader", 53 | "options": { 54 | "name": "[name].[hash:20].[ext]", 55 | "limit": 10000 56 | } 57 | }, 58 | { 59 | "test": /\.ts$/, 60 | "loader": "@ngtools/webpack" 61 | } 62 | ] 63 | }, 64 | "plugins": [ 65 | new NoEmitOnErrorsPlugin(), 66 | new CopyWebpackPlugin([ 67 | { 68 | "context": "src", 69 | "to": "", 70 | "from": { 71 | "glob": "assets\\**\\*", 72 | "dot": true 73 | } 74 | }, 75 | { 76 | "context": "src", 77 | "to": "", 78 | "from": { 79 | "glob": "favicon.ico", 80 | "dot": true 81 | } 82 | } 83 | ], { 84 | "ignore": [ 85 | ".gitkeep", 86 | "**/.DS_Store", 87 | "**/Thumbs.db" 88 | ], 89 | "debug": "warning" 90 | }), 91 | new ProgressPlugin(), 92 | new CircularDependencyPlugin({ 93 | "exclude": /(\\|\/)node_modules(\\|\/)/, 94 | "failOnError": false, 95 | "onDetected": false, 96 | "cwd": projectRoot 97 | }), 98 | new BaseHrefWebpackPlugin({}), 99 | new CommonsChunkPlugin({ 100 | "name": [ 101 | "inline" 102 | ], 103 | "minChunks": null 104 | }), 105 | new CommonsChunkPlugin({ 106 | "name": [ 107 | "main" 108 | ], 109 | "minChunks": 2, 110 | "async": "common" 111 | }) 112 | ], 113 | "node": { 114 | "fs": "empty", 115 | "global": true, 116 | "crypto": "empty", 117 | "tls": "empty", 118 | "net": "empty", 119 | "process": true, 120 | "module": false, 121 | "clearImmediate": false, 122 | "setImmediate": false 123 | }, 124 | "devServer": { 125 | "historyApiFallback": true 126 | } 127 | }; 128 | -------------------------------------------------------------------------------- /angular/app1/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('app1 App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to app!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /angular/app1/e2e/app.po.ngsummary.json: -------------------------------------------------------------------------------- 1 | {"summaries":[{"symbol":{"__symbol":0,"members":[]},"metadata":{"__symbolic":"class","members":{"navigateTo":[{"__symbolic":"method"}],"getParagraphText":[{"__symbolic":"method"}]}}}],"symbols":[{"__symbol":0,"name":"AppPage","filePath":"C:/Apache24/htdocs/Laravel_Apps/Lv_plus_Ng/angular_apps_cli/app1/e2e/app.po.d.ts"}]} -------------------------------------------------------------------------------- /angular/app1/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /angular/app1/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 | -------------------------------------------------------------------------------- /angular/app1/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/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 | -------------------------------------------------------------------------------- /angular/app1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "app1", 3 | "version": "0.0.0", 4 | "license": "MIT", 5 | "scripts": { 6 | "ng": "ng", 7 | "lint": "ng lint", 8 | "pree2e": "webdriver-manager update --standalone false --gecko false --quiet", 9 | "build": "webpack --config ./dev.config.js", 10 | "build-prod": "webpack --config ./prod.config.js", 11 | "watch": "webpack --watch", 12 | "start": "ng serve", 13 | "test": "ng test", 14 | "e2e": "ng e2e" 15 | }, 16 | "private": true, 17 | "dependencies": { 18 | "@angular/animations": "^5.2.0", 19 | "@angular/common": "^5.2.0", 20 | "@angular/compiler": "^5.2.0", 21 | "@angular/core": "^5.2.0", 22 | "@angular/forms": "^5.2.0", 23 | "@angular/http": "^5.2.0", 24 | "@angular/platform-browser": "^5.2.0", 25 | "@angular/platform-browser-dynamic": "^5.2.0", 26 | "@angular/router": "^5.2.0", 27 | "core-js": "^2.5.3", 28 | "rxjs": "^5.5.6", 29 | "zone.js": "^0.8.19" 30 | }, 31 | "devDependencies": { 32 | "@angular-devkit/core": "0.3.2", 33 | "@angular/cli": "~1.7.3", 34 | "@angular/compiler-cli": "^5.2.0", 35 | "@angular/language-service": "^5.2.0", 36 | "@ngtools/webpack": "1.10.2", 37 | "@types/jasmine": "~2.8.3", 38 | "@types/jasminewd2": "~2.0.2", 39 | "@types/node": "^6.0.103", 40 | "autoprefixer": "^7.2.3", 41 | "circular-dependency-plugin": "^4.2.1", 42 | "clean-webpack-plugin": "^0.1.19", 43 | "codelyzer": "^4.0.1", 44 | "copy-webpack-plugin": "~4.4.1", 45 | "file-loader": "^1.1.5", 46 | "html-webpack-plugin": "^2.29.0", 47 | "istanbul-instrumenter-loader": "^3.0.0", 48 | "jasmine-core": "~2.8.0", 49 | "jasmine-spec-reporter": "~4.2.1", 50 | "karma": "~2.0.0", 51 | "karma-chrome-launcher": "~2.2.0", 52 | "karma-coverage-istanbul-reporter": "^1.4.2", 53 | "karma-jasmine": "^1.1.1", 54 | "karma-jasmine-html-reporter": "^0.2.2", 55 | "less-loader": "^4.0.5", 56 | "postcss-import": "^11.0.0", 57 | "postcss-loader": "^2.0.10", 58 | "postcss-url": "^7.1.2", 59 | "protractor": "~5.1.2", 60 | "raw-loader": "^0.5.1", 61 | "sass-loader": "^6.0.6", 62 | "style-loader": "^0.19.1", 63 | "stylus-loader": "^3.0.1", 64 | "ts-node": "~4.1.0", 65 | "tslint": "~5.9.1", 66 | "typescript": "~2.5.3", 67 | "uglifyjs-webpack-plugin": "^1.1.8", 68 | "url-loader": "^0.6.2", 69 | "webpack-dev-server": "~2.11.0", 70 | "webpack-merge": "^4.1.2" 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /angular/app1/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 | -------------------------------------------------------------------------------- /angular/app1/src/app/app-routing/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | import { TestRoutingComponent } from './test-routing/test-routing.component'; 5 | 6 | export const routes: Routes = [ 7 | { path: 'eager/load', component: TestRoutingComponent}, 8 | { path: 'testlazyload', loadChildren: 'app/routing-test/routing-test.module#RoutingTestModule' }, 9 | { path: 'lazy/load', loadChildren: 'app/lazyload-example/lazyload-example.module#LazyloadExampleModule' }, 10 | ]; 11 | 12 | @NgModule({ 13 | imports: [RouterModule.forRoot(routes)], 14 | exports: [RouterModule] 15 | }) 16 | export class AppRoutingModule {} 17 | -------------------------------------------------------------------------------- /angular/app1/src/app/app-routing/test-routing/test-routing.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toni-rmc/laravel-angular-integration/13b4647f1f15569ca0bb26124a7e42fc8997e990/angular/app1/src/app/app-routing/test-routing/test-routing.component.css -------------------------------------------------------------------------------- /angular/app1/src/app/app-routing/test-routing/test-routing.component.html: -------------------------------------------------------------------------------- 1 |

App 1 Eager Routing Test

2 |
3 | We are eagerly routed here 4 |
5 | -------------------------------------------------------------------------------- /angular/app1/src/app/app-routing/test-routing/test-routing.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { TestRoutingComponent } from './test-routing.component'; 4 | 5 | describe('TestRoutingComponent', () => { 6 | let component: TestRoutingComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ TestRoutingComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(TestRoutingComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should be created', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /angular/app1/src/app/app-routing/test-routing/test-routing.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: './test-routing.component.html', 5 | styleUrls: ['./test-routing.component.css'] 6 | }) 7 | export class TestRoutingComponent { } 8 | -------------------------------------------------------------------------------- /angular/app1/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |

4 | Welcome to {{title}} from Laravel 5 |

6 | 7 |
8 | Hello Angular from Laravel, looks like App 1 works... 9 |

10 | 11 |

Here are some links to test routing:

12 | 13 | 18 | 19 | -------------------------------------------------------------------------------- /angular/app1/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 | -------------------------------------------------------------------------------- /angular/app1/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html' 6 | }) 7 | export class AppComponent { 8 | title = 'Angular'; 9 | } 10 | -------------------------------------------------------------------------------- /angular/app1/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | 4 | import { AppComponent } from './app.component'; 5 | import { TestRoutingComponent } from './app-routing/test-routing/test-routing.component'; 6 | import { MotivationsComponent } from './motivations/motivations.component'; 7 | 8 | /* Routing Module */ 9 | import { AppRoutingModule } from './app-routing/app-routing.module'; 10 | 11 | @NgModule({ 12 | declarations: [ 13 | AppComponent, 14 | TestRoutingComponent, 15 | MotivationsComponent 16 | ], 17 | imports: [ 18 | BrowserModule, 19 | AppRoutingModule 20 | ], 21 | providers: [], 22 | bootstrap: [AppComponent] 23 | }) 24 | export class AppModule { } 25 | -------------------------------------------------------------------------------- /angular/app1/src/app/lazyload-example/lazyload-example.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | 3 | import { LazyloadTestComponent } from './lazyload-test/lazyload-test.component'; 4 | 5 | import { LazyloadRoutingModule } from './lazyload-routing/lazyload-routing.module'; 6 | 7 | @NgModule({ 8 | declarations: [ 9 | LazyloadTestComponent 10 | ], 11 | imports: [ 12 | LazyloadRoutingModule 13 | ] 14 | }) 15 | export class LazyloadExampleModule { } 16 | -------------------------------------------------------------------------------- /angular/app1/src/app/lazyload-example/lazyload-routing/lazyload-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | import { LazyloadTestComponent } from '../lazyload-test/lazyload-test.component'; 5 | 6 | const routes: Routes = [ 7 | { path: '', component: LazyloadTestComponent }, 8 | ]; 9 | 10 | @NgModule({ 11 | imports: [RouterModule.forChild(routes)], 12 | exports: [RouterModule] 13 | }) 14 | export class LazyloadRoutingModule { } 15 | -------------------------------------------------------------------------------- /angular/app1/src/app/lazyload-example/lazyload-test/lazyload-test.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { LazyloadTestComponent } from './lazyload-test.component'; 4 | 5 | describe('LazyloadTestComponent', () => { 6 | let component: LazyloadTestComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ LazyloadTestComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(LazyloadTestComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should be created', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /angular/app1/src/app/lazyload-example/lazyload-test/lazyload-test.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | template: ` 5 |

Another App 1 Lazy Load Route Test

6 |
7 | Lazy load routing for App 1 works. 8 |
9 | ` 10 | }) 11 | export class LazyloadTestComponent { } 12 | -------------------------------------------------------------------------------- /angular/app1/src/app/motivations/motivations.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { MotivationsComponent } from './motivations.component'; 4 | 5 | describe('MotivationsComponent', () => { 6 | let component: MotivationsComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ MotivationsComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(MotivationsComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should be created', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /angular/app1/src/app/motivations/motivations.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-motivations', 5 | template: ` 6 |
Start building your app!
7 | ` 8 | }) 9 | export class MotivationsComponent { } 10 | -------------------------------------------------------------------------------- /angular/app1/src/app/routing-test/lazyload-routes/lazyload-routes.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | 4 | import { Routes, RouterModule } from '@angular/router'; 5 | 6 | import { TestLazyRouteComponent } from './test-lazy-route/test-lazy-route.component'; 7 | 8 | const routes: Routes = [ 9 | { path: '', component: TestLazyRouteComponent }, 10 | ]; 11 | 12 | @NgModule({ 13 | imports: [RouterModule.forChild(routes)], 14 | exports: [RouterModule] 15 | }) 16 | export class LazyloadRoutesModule { } 17 | -------------------------------------------------------------------------------- /angular/app1/src/app/routing-test/lazyload-routes/test-lazy-route/test-lazy-route.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toni-rmc/laravel-angular-integration/13b4647f1f15569ca0bb26124a7e42fc8997e990/angular/app1/src/app/routing-test/lazyload-routes/test-lazy-route/test-lazy-route.component.css -------------------------------------------------------------------------------- /angular/app1/src/app/routing-test/lazyload-routes/test-lazy-route/test-lazy-route.component.html: -------------------------------------------------------------------------------- 1 |

2 | test-lazy-route works! 3 |

4 | -------------------------------------------------------------------------------- /angular/app1/src/app/routing-test/lazyload-routes/test-lazy-route/test-lazy-route.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { TestLazyRouteComponent } from './test-lazy-route.component'; 4 | 5 | describe('TestLazyRouteComponent', () => { 6 | let component: TestLazyRouteComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ TestLazyRouteComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(TestLazyRouteComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should be created', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /angular/app1/src/app/routing-test/lazyload-routes/test-lazy-route/test-lazy-route.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-test-lazy-route', 5 | templateUrl: './test-lazy-route.component.html', 6 | styleUrls: ['./test-lazy-route.component.css'] 7 | }) 8 | export class TestLazyRouteComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /angular/app1/src/app/routing-test/routing-test.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | 4 | import { TestLazyRouteComponent } from './lazyload-routes/test-lazy-route/test-lazy-route.component'; 5 | 6 | import { LazyloadRoutesModule } from './lazyload-routes/lazyload-routes.module'; 7 | 8 | @NgModule({ 9 | imports: [ 10 | CommonModule, LazyloadRoutesModule 11 | ], 12 | declarations: [TestLazyRouteComponent] 13 | }) 14 | export class RoutingTestModule { } 15 | -------------------------------------------------------------------------------- /angular/app1/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toni-rmc/laravel-angular-integration/13b4647f1f15569ca0bb26124a7e42fc8997e990/angular/app1/src/assets/.gitkeep -------------------------------------------------------------------------------- /angular/app1/src/css/styles.css: -------------------------------------------------------------------------------- 1 | /* Master Styles */ 2 | h1 { 3 | color: #369; 4 | font-family: Arial, Helvetica, sans-serif; 5 | font-size: 250%; 6 | } 7 | h2, h3 { 8 | color: #444; 9 | font-family: Arial, Helvetica, sans-serif; 10 | font-weight: lighter; 11 | } 12 | body { 13 | margin: 2em; 14 | } 15 | body, input[text], button { 16 | color: #339966; 17 | font-family: Cambria, Georgia; 18 | } 19 | a { 20 | cursor: pointer; 21 | cursor: hand; 22 | } 23 | button { 24 | font-family: Arial; 25 | background-color: #eee; 26 | border: none; 27 | padding: 5px 10px; 28 | border-radius: 4px; 29 | cursor: pointer; 30 | cursor: hand; 31 | } 32 | button:hover { 33 | background-color: #cfd8dc; 34 | } 35 | button:disabled { 36 | background-color: #eee; 37 | color: #aaa; 38 | cursor: auto; 39 | } 40 | 41 | /* Navigation link styles */ 42 | nav a { 43 | padding: 5px 10px; 44 | text-decoration: none; 45 | margin-right: 10px; 46 | margin-top: 10px; 47 | display: inline-block; 48 | background-color: #eee; 49 | border-radius: 4px; 50 | } 51 | nav a:visited, a:link { 52 | color: #607D8B; 53 | } 54 | nav a:hover { 55 | color: #039be5; 56 | background-color: #CFD8DC; 57 | } 58 | nav a.active { 59 | color: #039be5; 60 | } 61 | 62 | /* items class */ 63 | .items { 64 | margin: 0 0 2em 0; 65 | list-style-type: none; 66 | padding: 0; 67 | width: 24em; 68 | } 69 | .items li { 70 | cursor: pointer; 71 | position: relative; 72 | left: 0; 73 | background-color: #EEE; 74 | margin: .5em; 75 | padding: .3em 0; 76 | height: 1.6em; 77 | border-radius: 4px; 78 | } 79 | .items li:hover { 80 | color: #607D8B; 81 | background-color: #DDD; 82 | left: .1em; 83 | } 84 | .items li.selected { 85 | background-color: #CFD8DC; 86 | color: white; 87 | } 88 | .items li.selected:hover { 89 | background-color: #BBD8DC; 90 | } 91 | .items .text { 92 | position: relative; 93 | top: -3px; 94 | } 95 | .items .badge { 96 | display: inline-block; 97 | font-size: small; 98 | color: white; 99 | padding: 0.8em 0.7em 0 0.7em; 100 | background-color: #607D8B; 101 | line-height: 1em; 102 | position: relative; 103 | left: -1px; 104 | top: -4px; 105 | height: 1.8em; 106 | margin-right: .8em; 107 | border-radius: 4px 0 0 4px; 108 | } 109 | /* everywhere else */ 110 | * { 111 | font-family: Arial, Helvetica, sans-serif; 112 | } 113 | .L { 114 | color: #e74430; 115 | font-family: Arial, Helvetica, sans-serif; 116 | font-size: 250%; 117 | } 118 | .laravel-title { 119 | color: #e74430; 120 | font-family: Arial, Helvetica, sans-serif; 121 | } 122 | .ng { 123 | color: #0D47A1; 124 | font-family: Arial, Helvetica, sans-serif; 125 | font-size: 250%; 126 | } -------------------------------------------------------------------------------- /angular/app1/src/environments/environment.ngsummary.json: -------------------------------------------------------------------------------- 1 | {"summaries":[{"symbol":{"__symbol":0,"members":[]},"metadata":{"production":false}}],"symbols":[{"__symbol":0,"name":"environment","filePath":"C:/Apache24/htdocs/Laravel_Apps/Lv_plus_Ng/angular_apps_cli/app1/src/environments/environment.d.ts"}]} -------------------------------------------------------------------------------- /angular/app1/src/environments/environment.prod.ngsummary.json: -------------------------------------------------------------------------------- 1 | {"summaries":[{"symbol":{"__symbol":0,"members":[]},"metadata":{"production":true}}],"symbols":[{"__symbol":0,"name":"environment","filePath":"C:/Apache24/htdocs/Laravel_Apps/Lv_plus_Ng/angular_apps_cli/app1/src/environments/environment.prod.d.ts"}]} -------------------------------------------------------------------------------- /angular/app1/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /angular/app1/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 | }; 9 | -------------------------------------------------------------------------------- /angular/app1/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toni-rmc/laravel-angular-integration/13b4647f1f15569ca0bb26124a7e42fc8997e990/angular/app1/src/favicon.ico -------------------------------------------------------------------------------- /angular/app1/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | App 1 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /angular/app1/src/laravel-ng-template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Angular App One 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /angular/app1/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 | -------------------------------------------------------------------------------- /angular/app1/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 | -------------------------------------------------------------------------------- /angular/app1/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /angular/app1/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 | -------------------------------------------------------------------------------- /angular/app1/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 | -------------------------------------------------------------------------------- /angular/app1/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 | -------------------------------------------------------------------------------- /angular/app1/src/typings.d.ts: -------------------------------------------------------------------------------- 1 | /* SystemJS module definition */ 2 | declare var module: NodeModule; 3 | interface NodeModule { 4 | id: string; 5 | } 6 | -------------------------------------------------------------------------------- /angular/app1/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 | ], 14 | "lib": [ 15 | "es2017", 16 | "dom" 17 | ] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /angular/app1/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 | -------------------------------------------------------------------------------- /angular/app2/.angular-cli.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "project": { 4 | "name": "app2", 5 | "ejected": false 6 | }, 7 | "apps": [ 8 | { 9 | "root": "src", 10 | "outDir": "dist", 11 | "assets": [ 12 | "assets", 13 | "favicon.ico" 14 | ], 15 | "index": "index.html", 16 | "main": "main.ts", 17 | "polyfills": "polyfills.ts", 18 | "test": "test.ts", 19 | "tsconfig": "tsconfig.app.json", 20 | "testTsconfig": "tsconfig.spec.json", 21 | "prefix": "app", 22 | "styles": [ 23 | "styles.css", 24 | "css/styles.css" 25 | ], 26 | "scripts": [], 27 | "environmentSource": "environments/environment.ts", 28 | "environments": { 29 | "dev": "environments/environment.ts", 30 | "prod": "environments/environment.prod.ts" 31 | } 32 | } 33 | ], 34 | "e2e": { 35 | "protractor": { 36 | "config": "./protractor.conf.js" 37 | } 38 | }, 39 | "lint": [ 40 | { 41 | "project": "src/tsconfig.app.json", 42 | "exclude": "**/node_modules/**" 43 | }, 44 | { 45 | "project": "src/tsconfig.spec.json", 46 | "exclude": "**/node_modules/**" 47 | }, 48 | { 49 | "project": "e2e/tsconfig.e2e.json", 50 | "exclude": "**/node_modules/**" 51 | } 52 | ], 53 | "test": { 54 | "karma": { 55 | "config": "./karma.conf.js" 56 | } 57 | }, 58 | "defaults": { 59 | "styleExt": "css", 60 | "component": { 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /angular/app2/.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 | -------------------------------------------------------------------------------- /angular/app2/.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 | yarn-error.log 36 | 37 | # e2e 38 | /e2e/*.js 39 | /e2e/*.map 40 | 41 | # System Files 42 | .DS_Store 43 | Thumbs.db 44 | -------------------------------------------------------------------------------- /angular/app2/README.md: -------------------------------------------------------------------------------- 1 | # NgCliApp2 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.3.2. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 24 | Before running the tests make sure you are serving the app via `ng serve`. 25 | 26 | ## Further help 27 | 28 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 29 | -------------------------------------------------------------------------------- /angular/app2/base.config.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | const CopyWebpackPlugin = require('copy-webpack-plugin'); 4 | const ProgressPlugin = require('webpack/lib/ProgressPlugin'); 5 | const CircularDependencyPlugin = require('circular-dependency-plugin'); 6 | const rxPaths = require('rxjs/_esm5/path-mapping'); 7 | 8 | const { NoEmitOnErrorsPlugin } = require('webpack'); 9 | const { BaseHrefWebpackPlugin } = require('@angular/cli/plugins/webpack'); 10 | const { CommonsChunkPlugin } = require('webpack').optimize; 11 | 12 | const nodeModules = path.join(process.cwd(), 'node_modules'); 13 | const realNodeModules = fs.realpathSync(nodeModules); 14 | const genDirNodeModules = path.join(process.cwd(), 'src', '$$_gendir', 'node_modules'); 15 | 16 | const projectRoot = process.cwd(); 17 | 18 | module.exports = { 19 | "resolve": { 20 | "extensions": [ 21 | ".ts", 22 | ".js" 23 | ], 24 | "symlinks": true, 25 | "modules": [ 26 | "./src", 27 | "./node_modules" 28 | ] 29 | }, 30 | "resolveLoader": { 31 | "modules": [ 32 | "./node_modules" 33 | ], 34 | "alias": rxPaths() 35 | }, 36 | "module": { 37 | "rules": [ 38 | { 39 | "test": /\.html$/, 40 | "loader": "raw-loader" 41 | }, 42 | { 43 | "test": /\.(eot|svg|cur)$/, 44 | "loader": "file-loader", 45 | "options": { 46 | "name": "[name].[hash:20].[ext]", 47 | "limit": 10000 48 | } 49 | }, 50 | { 51 | "test": /\.(jpg|png|webp|gif|otf|ttf|woff|woff2|ani)$/, 52 | "loader": "url-loader", 53 | "options": { 54 | "name": "[name].[hash:20].[ext]", 55 | "limit": 10000 56 | } 57 | }, 58 | { 59 | "test": /\.ts$/, 60 | "loader": "@ngtools/webpack" 61 | } 62 | ] 63 | }, 64 | "plugins": [ 65 | new NoEmitOnErrorsPlugin(), 66 | new CopyWebpackPlugin([ 67 | { 68 | "context": "src", 69 | "to": "", 70 | "from": { 71 | "glob": "assets\\**\\*", 72 | "dot": true 73 | } 74 | }, 75 | { 76 | "context": "src", 77 | "to": "", 78 | "from": { 79 | "glob": "favicon.ico", 80 | "dot": true 81 | } 82 | } 83 | ], { 84 | "ignore": [ 85 | ".gitkeep", 86 | "**/.DS_Store", 87 | "**/Thumbs.db" 88 | ], 89 | "debug": "warning" 90 | }), 91 | new ProgressPlugin(), 92 | new CircularDependencyPlugin({ 93 | "exclude": /(\\|\/)node_modules(\\|\/)/, 94 | "failOnError": false, 95 | "onDetected": false, 96 | "cwd": projectRoot 97 | }), 98 | new BaseHrefWebpackPlugin({}), 99 | new CommonsChunkPlugin({ 100 | "name": [ 101 | "inline" 102 | ], 103 | "minChunks": null 104 | }), 105 | new CommonsChunkPlugin({ 106 | "name": [ 107 | "main" 108 | ], 109 | "minChunks": 2, 110 | "async": "common" 111 | }) 112 | ], 113 | "node": { 114 | "fs": "empty", 115 | "global": true, 116 | "crypto": "empty", 117 | "tls": "empty", 118 | "net": "empty", 119 | "process": true, 120 | "module": false, 121 | "clearImmediate": false, 122 | "setImmediate": false 123 | }, 124 | "devServer": { 125 | "historyApiFallback": true 126 | } 127 | }; 128 | -------------------------------------------------------------------------------- /angular/app2/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('ng-cli-app2 App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to app!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /angular/app2/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /angular/app2/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 | -------------------------------------------------------------------------------- /angular/app2/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/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 | -------------------------------------------------------------------------------- /angular/app2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "app2", 3 | "version": "0.0.0", 4 | "license": "MIT", 5 | "scripts": { 6 | "ng": "ng", 7 | "lint": "ng lint", 8 | "pree2e": "webdriver-manager update --standalone false --gecko false --quiet", 9 | "build": "webpack --config ./dev.config.js", 10 | "build-prod": "webpack --config ./prod.config.js", 11 | "watch": "webpack --watch", 12 | "start": "ng serve", 13 | "test": "ng test", 14 | "e2e": "ng e2e" 15 | }, 16 | "private": true, 17 | "dependencies": { 18 | "@angular/animations": "^5.2.0", 19 | "@angular/common": "^5.2.0", 20 | "@angular/compiler": "^5.2.0", 21 | "@angular/core": "^5.2.0", 22 | "@angular/forms": "^5.2.0", 23 | "@angular/http": "^5.2.0", 24 | "@angular/platform-browser": "^5.2.0", 25 | "@angular/platform-browser-dynamic": "^5.2.0", 26 | "@angular/router": "^5.2.0", 27 | "core-js": "^2.5.3", 28 | "rxjs": "^5.5.6", 29 | "zone.js": "^0.8.19" 30 | }, 31 | "devDependencies": { 32 | "@angular-devkit/core": "0.3.2", 33 | "@angular/cli": "~1.7.3", 34 | "@angular/compiler-cli": "^5.2.0", 35 | "@angular/language-service": "^5.2.0", 36 | "@ngtools/webpack": "1.10.2", 37 | "@types/jasmine": "~2.8.3", 38 | "@types/jasminewd2": "~2.0.2", 39 | "@types/node": "^6.0.103", 40 | "autoprefixer": "^7.2.3", 41 | "circular-dependency-plugin": "^4.2.1", 42 | "clean-webpack-plugin": "^0.1.19", 43 | "codelyzer": "^4.0.1", 44 | "copy-webpack-plugin": "~4.4.1", 45 | "file-loader": "^1.1.5", 46 | "html-webpack-plugin": "^2.29.0", 47 | "istanbul-instrumenter-loader": "^3.0.0", 48 | "jasmine-core": "~2.8.0", 49 | "jasmine-spec-reporter": "~4.2.1", 50 | "karma": "~2.0.0", 51 | "karma-chrome-launcher": "~2.2.0", 52 | "karma-coverage-istanbul-reporter": "^1.4.2", 53 | "karma-jasmine": "^1.1.1", 54 | "karma-jasmine-html-reporter": "^0.2.2", 55 | "less-loader": "^4.0.5", 56 | "postcss-import": "^11.0.0", 57 | "postcss-loader": "^2.0.10", 58 | "postcss-url": "^7.1.2", 59 | "protractor": "~5.1.2", 60 | "raw-loader": "^0.5.1", 61 | "sass-loader": "^6.0.6", 62 | "style-loader": "^0.19.1", 63 | "stylus-loader": "^3.0.1", 64 | "ts-node": "~4.1.0", 65 | "tslint": "~5.9.1", 66 | "typescript": "~2.5.3", 67 | "uglifyjs-webpack-plugin": "^1.1.8", 68 | "url-loader": "^0.6.2", 69 | "webpack-dev-server": "~2.11.0", 70 | "webpack-merge": "^4.1.2" 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /angular/app2/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 | -------------------------------------------------------------------------------- /angular/app2/src/app/app-routing/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | import { TestRoutingComponent } from './test-routing/test-routing.component'; 5 | 6 | export const routes: Routes = [ 7 | { path: 'eager/load', component: TestRoutingComponent}, 8 | { path: 'testlazyload', loadChildren: 'app/routing-test/routing-test.module#RoutingTestModule' }, 9 | { path: 'lazy/load', loadChildren: 'app/lazyload-example/lazyload-example.module#LazyloadExampleModule' }, 10 | ]; 11 | 12 | @NgModule({ 13 | imports: [RouterModule.forRoot(routes)], 14 | exports: [RouterModule] 15 | }) 16 | export class AppRoutingModule {} 17 | -------------------------------------------------------------------------------- /angular/app2/src/app/app-routing/test-routing/test-routing.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toni-rmc/laravel-angular-integration/13b4647f1f15569ca0bb26124a7e42fc8997e990/angular/app2/src/app/app-routing/test-routing/test-routing.component.css -------------------------------------------------------------------------------- /angular/app2/src/app/app-routing/test-routing/test-routing.component.html: -------------------------------------------------------------------------------- 1 |

App 2 Eager Routing Test

2 |
3 | We are eagerly routed here 4 |
5 | -------------------------------------------------------------------------------- /angular/app2/src/app/app-routing/test-routing/test-routing.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { TestRoutingComponent } from './test-routing.component'; 4 | 5 | describe('TestRoutingComponent', () => { 6 | let component: TestRoutingComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ TestRoutingComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(TestRoutingComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should be created', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /angular/app2/src/app/app-routing/test-routing/test-routing.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: './test-routing.component.html', 5 | styleUrls: ['./test-routing.component.css'] 6 | }) 7 | export class TestRoutingComponent { } 8 | -------------------------------------------------------------------------------- /angular/app2/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |

4 | Welcome to {{title}} from Laravel 5 |

6 | 7 |
8 | Hello Angular from Laravel, looks like App 2 works... 9 |

10 | 11 |

Here are some links to test routing:

12 | 13 | 18 | 19 | -------------------------------------------------------------------------------- /angular/app2/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 | -------------------------------------------------------------------------------- /angular/app2/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html' 6 | }) 7 | export class AppComponent { 8 | title = 'Angular'; 9 | } 10 | -------------------------------------------------------------------------------- /angular/app2/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | 4 | import { AppComponent } from './app.component'; 5 | import { TestRoutingComponent } from './app-routing/test-routing/test-routing.component'; 6 | import { MotivationsComponent } from './motivations/motivations.component'; 7 | 8 | /* Routing Module */ 9 | import { AppRoutingModule } from './app-routing/app-routing.module'; 10 | 11 | @NgModule({ 12 | declarations: [ 13 | AppComponent, 14 | TestRoutingComponent, 15 | MotivationsComponent 16 | ], 17 | imports: [ 18 | BrowserModule, 19 | AppRoutingModule 20 | ], 21 | providers: [], 22 | bootstrap: [AppComponent] 23 | }) 24 | export class AppModule { } 25 | -------------------------------------------------------------------------------- /angular/app2/src/app/lazyload-example/lazyload-example.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { LazyloadTestComponent } from './lazyload-test/lazyload-test.component'; 3 | import { LazyloadRoutingModule } from './lazyload-routing/lazyload-routing.module'; 4 | 5 | @NgModule({ 6 | declarations: [ 7 | LazyloadTestComponent 8 | ], 9 | imports: [ 10 | LazyloadRoutingModule 11 | ] 12 | }) 13 | export class LazyloadExampleModule { } 14 | -------------------------------------------------------------------------------- /angular/app2/src/app/lazyload-example/lazyload-routing/lazyload-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | import { LazyloadTestComponent } from '../lazyload-test/lazyload-test.component'; 5 | 6 | const routes: Routes = [ 7 | { path: '', component: LazyloadTestComponent }, 8 | ]; 9 | 10 | @NgModule({ 11 | imports: [RouterModule.forChild(routes)], 12 | exports: [RouterModule] 13 | }) 14 | export class LazyloadRoutingModule { } 15 | -------------------------------------------------------------------------------- /angular/app2/src/app/lazyload-example/lazyload-test/lazyload-test.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { LazyloadTestComponent } from './lazyload-test.component'; 4 | 5 | describe('LazyloadTestComponent', () => { 6 | let component: LazyloadTestComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ LazyloadTestComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(LazyloadTestComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should be created', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /angular/app2/src/app/lazyload-example/lazyload-test/lazyload-test.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | template: ` 5 |

Another App 2 Lazy Load Route Test

6 |
7 | Lazy load routing for App 2 works. 8 |
9 | ` 10 | }) 11 | export class LazyloadTestComponent { } 12 | -------------------------------------------------------------------------------- /angular/app2/src/app/motivations/motivations.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { MotivationsComponent } from './motivations.component'; 4 | 5 | describe('MotivationsComponent', () => { 6 | let component: MotivationsComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ MotivationsComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(MotivationsComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should be created', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /angular/app2/src/app/motivations/motivations.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-motivations', 5 | template: ` 6 |
Start building your app!
7 | ` 8 | }) 9 | export class MotivationsComponent { } 10 | -------------------------------------------------------------------------------- /angular/app2/src/app/routing-test/lazyload-routes/lazyload-routes.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | 4 | import { Routes, RouterModule } from '@angular/router'; 5 | 6 | import { TestLazyRouteComponent } from '../test-lazy-route/test-lazy-route.component'; 7 | 8 | const routes: Routes = [ 9 | { path: '', component: TestLazyRouteComponent }, 10 | ]; 11 | 12 | @NgModule({ 13 | imports: [RouterModule.forChild(routes)], 14 | exports: [RouterModule] 15 | }) 16 | export class LazyloadRoutesModule { } 17 | -------------------------------------------------------------------------------- /angular/app2/src/app/routing-test/routing-test.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { TestLazyRouteComponent } from './test-lazy-route/test-lazy-route.component'; 4 | 5 | import { LazyloadRoutesModule } from './lazyload-routes/lazyload-routes.module'; 6 | 7 | @NgModule({ 8 | imports: [ 9 | CommonModule, LazyloadRoutesModule 10 | ], 11 | declarations: [TestLazyRouteComponent] 12 | }) 13 | export class RoutingTestModule { } 14 | -------------------------------------------------------------------------------- /angular/app2/src/app/routing-test/test-lazy-route/test-lazy-route.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toni-rmc/laravel-angular-integration/13b4647f1f15569ca0bb26124a7e42fc8997e990/angular/app2/src/app/routing-test/test-lazy-route/test-lazy-route.component.css -------------------------------------------------------------------------------- /angular/app2/src/app/routing-test/test-lazy-route/test-lazy-route.component.html: -------------------------------------------------------------------------------- 1 |

2 | test-lazy-route works! 3 |

4 | -------------------------------------------------------------------------------- /angular/app2/src/app/routing-test/test-lazy-route/test-lazy-route.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { TestLazyRouteComponent } from './test-lazy-route.component'; 4 | 5 | describe('TestLazyRouteComponent', () => { 6 | let component: TestLazyRouteComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ TestLazyRouteComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(TestLazyRouteComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should be created', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /angular/app2/src/app/routing-test/test-lazy-route/test-lazy-route.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-test-lazy-route', 5 | templateUrl: './test-lazy-route.component.html', 6 | styleUrls: ['./test-lazy-route.component.css'] 7 | }) 8 | export class TestLazyRouteComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /angular/app2/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toni-rmc/laravel-angular-integration/13b4647f1f15569ca0bb26124a7e42fc8997e990/angular/app2/src/assets/.gitkeep -------------------------------------------------------------------------------- /angular/app2/src/css/styles.css: -------------------------------------------------------------------------------- 1 | /* Master Styles */ 2 | h1 { 3 | color: #369; 4 | font-family: Arial, Helvetica, sans-serif; 5 | font-size: 250%; 6 | } 7 | h2, h3 { 8 | color: #444; 9 | font-family: Arial, Helvetica, sans-serif; 10 | font-weight: lighter; 11 | } 12 | body { 13 | margin: 2em; 14 | } 15 | body, input[text], button { 16 | color: #339966; 17 | font-family: Cambria, Georgia; 18 | } 19 | a { 20 | cursor: pointer; 21 | cursor: hand; 22 | } 23 | button { 24 | font-family: Arial; 25 | background-color: #eee; 26 | border: none; 27 | padding: 5px 10px; 28 | border-radius: 4px; 29 | cursor: pointer; 30 | cursor: hand; 31 | } 32 | button:hover { 33 | background-color: #cfd8dc; 34 | } 35 | button:disabled { 36 | background-color: #eee; 37 | color: #aaa; 38 | cursor: auto; 39 | } 40 | 41 | /* Navigation link styles */ 42 | nav a { 43 | padding: 5px 10px; 44 | text-decoration: none; 45 | margin-right: 10px; 46 | margin-top: 10px; 47 | display: inline-block; 48 | background-color: #eee; 49 | border-radius: 4px; 50 | } 51 | nav a:visited, a:link { 52 | color: #607D8B; 53 | } 54 | nav a:hover { 55 | color: #039be5; 56 | background-color: #CFD8DC; 57 | } 58 | nav a.active { 59 | color: #039be5; 60 | } 61 | 62 | /* items class */ 63 | .items { 64 | margin: 0 0 2em 0; 65 | list-style-type: none; 66 | padding: 0; 67 | width: 24em; 68 | } 69 | .items li { 70 | cursor: pointer; 71 | position: relative; 72 | left: 0; 73 | background-color: #EEE; 74 | margin: .5em; 75 | padding: .3em 0; 76 | height: 1.6em; 77 | border-radius: 4px; 78 | } 79 | .items li:hover { 80 | color: #607D8B; 81 | background-color: #DDD; 82 | left: .1em; 83 | } 84 | .items li.selected { 85 | background-color: #CFD8DC; 86 | color: white; 87 | } 88 | .items li.selected:hover { 89 | background-color: #BBD8DC; 90 | } 91 | .items .text { 92 | position: relative; 93 | top: -3px; 94 | } 95 | .items .badge { 96 | display: inline-block; 97 | font-size: small; 98 | color: white; 99 | padding: 0.8em 0.7em 0 0.7em; 100 | background-color: #607D8B; 101 | line-height: 1em; 102 | position: relative; 103 | left: -1px; 104 | top: -4px; 105 | height: 1.8em; 106 | margin-right: .8em; 107 | border-radius: 4px 0 0 4px; 108 | } 109 | /* everywhere else */ 110 | * { 111 | font-family: Arial, Helvetica, sans-serif; 112 | } 113 | .L { 114 | color: #e74430; 115 | font-family: Arial, Helvetica, sans-serif; 116 | font-size: 250%; 117 | } 118 | .laravel-title { 119 | color: #e74430; 120 | font-family: Arial, Helvetica, sans-serif; 121 | } 122 | .ng { 123 | color: #0D47A1; 124 | font-family: Arial, Helvetica, sans-serif; 125 | font-size: 250%; 126 | } -------------------------------------------------------------------------------- /angular/app2/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /angular/app2/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 | }; 9 | -------------------------------------------------------------------------------- /angular/app2/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/toni-rmc/laravel-angular-integration/13b4647f1f15569ca0bb26124a7e42fc8997e990/angular/app2/src/favicon.ico -------------------------------------------------------------------------------- /angular/app2/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | App 2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /angular/app2/src/laravel-ng-template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Angular App Two 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /angular/app2/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 | -------------------------------------------------------------------------------- /angular/app2/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 | -------------------------------------------------------------------------------- /angular/app2/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /angular/app2/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 | -------------------------------------------------------------------------------- /angular/app2/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 | -------------------------------------------------------------------------------- /angular/app2/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 | -------------------------------------------------------------------------------- /angular/app2/src/typings.d.ts: -------------------------------------------------------------------------------- 1 | /* SystemJS module definition */ 2 | declare var module: NodeModule; 3 | interface NodeModule { 4 | id: string; 5 | } 6 | -------------------------------------------------------------------------------- /angular/app2/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 | ], 14 | "lib": [ 15 | "es2017", 16 | "dom" 17 | ] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /angular/app2/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 | -------------------------------------------------------------------------------- /angular/webpack_config/base/base.config.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | const CopyWebpackPlugin = require('copy-webpack-plugin'); 4 | const ProgressPlugin = require('webpack/lib/ProgressPlugin'); 5 | const CircularDependencyPlugin = require('circular-dependency-plugin'); 6 | const rxPaths = require('rxjs/_esm5/path-mapping'); 7 | 8 | const { NoEmitOnErrorsPlugin } = require('webpack'); 9 | const { BaseHrefWebpackPlugin } = require('@angular/cli/plugins/webpack'); 10 | const { CommonsChunkPlugin } = require('webpack').optimize; 11 | 12 | const nodeModules = path.join(process.cwd(), 'node_modules'); 13 | const realNodeModules = fs.realpathSync(nodeModules); 14 | const genDirNodeModules = path.join(process.cwd(), 'src', '$$_gendir', 'node_modules'); 15 | 16 | const projectRoot = process.cwd(); 17 | 18 | module.exports = { 19 | "resolve": { 20 | "extensions": [ 21 | ".ts", 22 | ".js" 23 | ], 24 | "symlinks": true, 25 | "modules": [ 26 | "./src", 27 | "./node_modules" 28 | ] 29 | }, 30 | "resolveLoader": { 31 | "modules": [ 32 | "./node_modules" 33 | ], 34 | "alias": rxPaths() 35 | }, 36 | "module": { 37 | "rules": [ 38 | { 39 | "test": /\.html$/, 40 | "loader": "raw-loader" 41 | }, 42 | { 43 | "test": /\.(eot|svg|cur)$/, 44 | "loader": "file-loader", 45 | "options": { 46 | "name": "[name].[hash:20].[ext]", 47 | "limit": 10000 48 | } 49 | }, 50 | { 51 | "test": /\.(jpg|png|webp|gif|otf|ttf|woff|woff2|ani)$/, 52 | "loader": "url-loader", 53 | "options": { 54 | "name": "[name].[hash:20].[ext]", 55 | "limit": 10000 56 | } 57 | }, 58 | { 59 | "test": /\.ts$/, 60 | "loader": "@ngtools/webpack" 61 | } 62 | ] 63 | }, 64 | "plugins": [ 65 | new NoEmitOnErrorsPlugin(), 66 | new CopyWebpackPlugin([ 67 | { 68 | "context": "src", 69 | "to": "", 70 | "from": { 71 | "glob": "assets\\**\\*", 72 | "dot": true 73 | } 74 | }, 75 | { 76 | "context": "src", 77 | "to": "", 78 | "from": { 79 | "glob": "favicon.ico", 80 | "dot": true 81 | } 82 | } 83 | ], { 84 | "ignore": [ 85 | ".gitkeep", 86 | "**/.DS_Store", 87 | "**/Thumbs.db" 88 | ], 89 | "debug": "warning" 90 | }), 91 | new ProgressPlugin(), 92 | new CircularDependencyPlugin({ 93 | "exclude": /(\\|\/)node_modules(\\|\/)/, 94 | "failOnError": false, 95 | "onDetected": false, 96 | "cwd": projectRoot 97 | }), 98 | new BaseHrefWebpackPlugin({}), 99 | new CommonsChunkPlugin({ 100 | "name": [ 101 | "inline" 102 | ], 103 | "minChunks": null 104 | }), 105 | new CommonsChunkPlugin({ 106 | "name": [ 107 | "main" 108 | ], 109 | "minChunks": 2, 110 | "async": "common" 111 | }) 112 | ], 113 | "node": { 114 | "fs": "empty", 115 | "global": true, 116 | "crypto": "empty", 117 | "tls": "empty", 118 | "net": "empty", 119 | "process": true, 120 | "module": false, 121 | "clearImmediate": false, 122 | "setImmediate": false 123 | }, 124 | "devServer": { 125 | "historyApiFallback": true 126 | } 127 | }; 128 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire') 28 | // ->hourly(); 29 | } 30 | 31 | /** 32 | * Register the Closure based commands for the application. 33 | * 34 | * @return void 35 | */ 36 | protected function commands() 37 | { 38 | require base_path('routes/console.php'); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | expectsJson()) { 60 | return response()->json(['error' => 'Unauthenticated.'], 401); 61 | } 62 | 63 | return redirect()->guest(route('login')); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ForgotPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/LoginController.php: -------------------------------------------------------------------------------- 1 | middleware('guest')->except('logout'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/RegisterController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 40 | } 41 | 42 | /** 43 | * Get a validator for an incoming registration request. 44 | * 45 | * @param array $data 46 | * @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 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 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ResetPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | [ 30 | \App\Http\Middleware\EncryptCookies::class, 31 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, 32 | \Illuminate\Session\Middleware\StartSession::class, 33 | // \Illuminate\Session\Middleware\AuthenticateSession::class, 34 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 35 | \App\Http\Middleware\VerifyCsrfToken::class, 36 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 37 | ], 38 | 39 | 'api' => [ 40 | 'throttle:60,1', 41 | 'bindings', 42 | ], 43 | ]; 44 | 45 | /** 46 | * The application's route middleware. 47 | * 48 | * These middleware may be assigned to groups or used individually. 49 | * 50 | * @var array 51 | */ 52 | protected $routeMiddleware = [ 53 | 'auth' => \Illuminate\Auth\Middleware\Authenticate::class, 54 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 55 | 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, 56 | 'can' => \Illuminate\Auth\Middleware\Authorize::class, 57 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 58 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 59 | ]; 60 | } 61 | -------------------------------------------------------------------------------- /app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | check()) { 21 | return redirect('/home'); 22 | } 23 | 24 | return $next($request); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrimStrings.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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /app/User.php: -------------------------------------------------------------------------------- 1 | make(Illuminate\Contracts\Console\Kernel::class); 32 | 33 | $status = $kernel->handle( 34 | $input = new Symfony\Component\Console\Input\ArgvInput, 35 | new Symfony\Component\Console\Output\ConsoleOutput 36 | ); 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Shutdown The Application 41 | |-------------------------------------------------------------------------- 42 | | 43 | | Once Artisan has finished running, we will fire off the shutdown events 44 | | so that any final work may be done by the application before we shut 45 | | down the process. This is the last thing to happen to the request. 46 | | 47 | */ 48 | 49 | $kernel->terminate($input, $status); 50 | 51 | exit($status); 52 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | Illuminate\Contracts\Http\Kernel::class, 31 | App\Http\Kernel::class 32 | ); 33 | 34 | $app->singleton( 35 | Illuminate\Contracts\Console\Kernel::class, 36 | App\Console\Kernel::class 37 | ); 38 | 39 | $app->singleton( 40 | Illuminate\Contracts\Debug\ExceptionHandler::class, 41 | App\Exceptions\Handler::class 42 | ); 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Return The Application 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This script returns the application instance. The instance is given to 50 | | the calling script so we can separate the building of the instances 51 | | from the actual running of the application and sending responses. 52 | | 53 | */ 54 | 55 | return $app; 56 | -------------------------------------------------------------------------------- /bootstrap/autoload.php: -------------------------------------------------------------------------------- 1 | env('APP_NAME', 'Laravel'), 16 | 17 | /* 18 | |-------------------------------------------------------------------------- 19 | | Application Environment 20 | |-------------------------------------------------------------------------- 21 | | 22 | | This value determines the "environment" your application is currently 23 | | running in. This may determine how you prefer to configure various 24 | | services your application utilizes. Set this in your ".env" file. 25 | | 26 | */ 27 | 28 | 'env' => env('APP_ENV', 'production'), 29 | 30 | /* 31 | |-------------------------------------------------------------------------- 32 | | Application Debug Mode 33 | |-------------------------------------------------------------------------- 34 | | 35 | | When your application is in debug mode, detailed error messages with 36 | | stack traces will be shown on every error that occurs within your 37 | | application. If disabled, a simple generic error page is shown. 38 | | 39 | */ 40 | 41 | 'debug' => env('APP_DEBUG', false), 42 | 43 | /* 44 | |-------------------------------------------------------------------------- 45 | | Application URL 46 | |-------------------------------------------------------------------------- 47 | | 48 | | This URL is used by the console to properly generate URLs when using 49 | | the Artisan command line tool. You should set this to the root of 50 | | your application so that it is used when running Artisan tasks. 51 | | 52 | */ 53 | 54 | 'url' => env('APP_URL', 'http://localhost'), 55 | 56 | /* 57 | |-------------------------------------------------------------------------- 58 | | Application Timezone 59 | |-------------------------------------------------------------------------- 60 | | 61 | | Here you may specify the default timezone for your application, which 62 | | will be used by the PHP date and date-time functions. We have gone 63 | | ahead and set this to a sensible default for you out of the box. 64 | | 65 | */ 66 | 67 | 'timezone' => 'UTC', 68 | 69 | /* 70 | |-------------------------------------------------------------------------- 71 | | Application Locale Configuration 72 | |-------------------------------------------------------------------------- 73 | | 74 | | The application locale determines the default locale that will be used 75 | | by the translation service provider. You are free to set this value 76 | | to any of the locales which will be supported by the application. 77 | | 78 | */ 79 | 80 | 'locale' => 'en', 81 | 82 | /* 83 | |-------------------------------------------------------------------------- 84 | | Application Fallback Locale 85 | |-------------------------------------------------------------------------- 86 | | 87 | | The fallback locale determines the locale to use when the current one 88 | | is not available. You may change the value to correspond to any of 89 | | the language folders that are provided through your application. 90 | | 91 | */ 92 | 93 | 'fallback_locale' => 'en', 94 | 95 | /* 96 | |-------------------------------------------------------------------------- 97 | | Encryption Key 98 | |-------------------------------------------------------------------------- 99 | | 100 | | This key is used by the Illuminate encrypter service and should be set 101 | | to a random, 32 character string, otherwise these encrypted strings 102 | | will not be safe. Please do this before deploying an application! 103 | | 104 | */ 105 | 106 | 'key' => env('APP_KEY'), 107 | 108 | 'cipher' => 'AES-256-CBC', 109 | 110 | /* 111 | |-------------------------------------------------------------------------- 112 | | Logging Configuration 113 | |-------------------------------------------------------------------------- 114 | | 115 | | Here you may configure the log settings for your application. Out of 116 | | the box, Laravel uses the Monolog PHP logging library. This gives 117 | | you a variety of powerful log handlers / formatters to utilize. 118 | | 119 | | Available Settings: "single", "daily", "syslog", "errorlog" 120 | | 121 | */ 122 | 123 | 'log' => env('APP_LOG', 'single'), 124 | 125 | 'log_level' => env('APP_LOG_LEVEL', 'debug'), 126 | 127 | /* 128 | |-------------------------------------------------------------------------- 129 | | Autoloaded Service Providers 130 | |-------------------------------------------------------------------------- 131 | | 132 | | The service providers listed here will be automatically loaded on the 133 | | request to your application. Feel free to add your own services to 134 | | this array to grant expanded functionality to your applications. 135 | | 136 | */ 137 | 138 | 'providers' => [ 139 | 140 | /* 141 | * Laravel Framework Service Providers... 142 | */ 143 | Illuminate\Auth\AuthServiceProvider::class, 144 | Illuminate\Broadcasting\BroadcastServiceProvider::class, 145 | Illuminate\Bus\BusServiceProvider::class, 146 | Illuminate\Cache\CacheServiceProvider::class, 147 | Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, 148 | Illuminate\Cookie\CookieServiceProvider::class, 149 | Illuminate\Database\DatabaseServiceProvider::class, 150 | Illuminate\Encryption\EncryptionServiceProvider::class, 151 | Illuminate\Filesystem\FilesystemServiceProvider::class, 152 | Illuminate\Foundation\Providers\FoundationServiceProvider::class, 153 | Illuminate\Hashing\HashServiceProvider::class, 154 | Illuminate\Mail\MailServiceProvider::class, 155 | Illuminate\Notifications\NotificationServiceProvider::class, 156 | Illuminate\Pagination\PaginationServiceProvider::class, 157 | Illuminate\Pipeline\PipelineServiceProvider::class, 158 | Illuminate\Queue\QueueServiceProvider::class, 159 | Illuminate\Redis\RedisServiceProvider::class, 160 | Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, 161 | Illuminate\Session\SessionServiceProvider::class, 162 | Illuminate\Translation\TranslationServiceProvider::class, 163 | Illuminate\Validation\ValidationServiceProvider::class, 164 | Illuminate\View\ViewServiceProvider::class, 165 | 166 | /* 167 | * Package Service Providers... 168 | */ 169 | Laravel\Tinker\TinkerServiceProvider::class, 170 | 171 | /* 172 | * Application Service Providers... 173 | */ 174 | App\Providers\AppServiceProvider::class, 175 | App\Providers\AuthServiceProvider::class, 176 | // App\Providers\BroadcastServiceProvider::class, 177 | App\Providers\EventServiceProvider::class, 178 | App\Providers\RouteServiceProvider::class, 179 | 180 | ], 181 | 182 | /* 183 | |-------------------------------------------------------------------------- 184 | | Class Aliases 185 | |-------------------------------------------------------------------------- 186 | | 187 | | This array of class aliases will be registered when this application 188 | | is started. However, feel free to register as many as you wish as 189 | | the aliases are "lazy" loaded so they don't hinder performance. 190 | | 191 | */ 192 | 193 | 'aliases' => [ 194 | 195 | 'App' => Illuminate\Support\Facades\App::class, 196 | 'Artisan' => Illuminate\Support\Facades\Artisan::class, 197 | 'Auth' => Illuminate\Support\Facades\Auth::class, 198 | 'Blade' => Illuminate\Support\Facades\Blade::class, 199 | 'Broadcast' => Illuminate\Support\Facades\Broadcast::class, 200 | 'Bus' => Illuminate\Support\Facades\Bus::class, 201 | 'Cache' => Illuminate\Support\Facades\Cache::class, 202 | 'Config' => Illuminate\Support\Facades\Config::class, 203 | 'Cookie' => Illuminate\Support\Facades\Cookie::class, 204 | 'Crypt' => Illuminate\Support\Facades\Crypt::class, 205 | 'DB' => Illuminate\Support\Facades\DB::class, 206 | 'Eloquent' => Illuminate\Database\Eloquent\Model::class, 207 | 'Event' => Illuminate\Support\Facades\Event::class, 208 | 'File' => Illuminate\Support\Facades\File::class, 209 | 'Gate' => Illuminate\Support\Facades\Gate::class, 210 | 'Hash' => Illuminate\Support\Facades\Hash::class, 211 | 'Lang' => Illuminate\Support\Facades\Lang::class, 212 | 'Log' => Illuminate\Support\Facades\Log::class, 213 | 'Mail' => Illuminate\Support\Facades\Mail::class, 214 | 'Notification' => Illuminate\Support\Facades\Notification::class, 215 | 'Password' => Illuminate\Support\Facades\Password::class, 216 | 'Queue' => Illuminate\Support\Facades\Queue::class, 217 | 'Redirect' => Illuminate\Support\Facades\Redirect::class, 218 | 'Redis' => Illuminate\Support\Facades\Redis::class, 219 | 'Request' => Illuminate\Support\Facades\Request::class, 220 | 'Response' => Illuminate\Support\Facades\Response::class, 221 | 'Route' => Illuminate\Support\Facades\Route::class, 222 | 'Schema' => Illuminate\Support\Facades\Schema::class, 223 | 'Session' => Illuminate\Support\Facades\Session::class, 224 | 'Storage' => Illuminate\Support\Facades\Storage::class, 225 | 'URL' => Illuminate\Support\Facades\URL::class, 226 | 'Validator' => Illuminate\Support\Facades\Validator::class, 227 | 'View' => Illuminate\Support\Facades\View::class, 228 | 229 | ], 230 | 231 | ]; 232 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_DRIVER', 'sync'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Queue Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may configure the connection information for each server that 26 | | is used by your application. A default configuration has been added 27 | | for each back-end shipped with Laravel. You are free to add more. 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'sync' => [ 34 | 'driver' => 'sync', 35 | ], 36 | 37 | 'database' => [ 38 | 'driver' => 'database', 39 | 'table' => 'jobs', 40 | 'queue' => 'default', 41 | 'retry_after' => 90, 42 | ], 43 | 44 | 'beanstalkd' => [ 45 | 'driver' => 'beanstalkd', 46 | 'host' => 'localhost', 47 | 'queue' => 'default', 48 | 'retry_after' => 90, 49 | ], 50 | 51 | 'sqs' => [ 52 | 'driver' => 'sqs', 53 | 'key' => 'your-public-key', 54 | 'secret' => 'your-secret-key', 55 | 'prefix' => 'https://sqs.us-east-1.amazonaws.com/your-account-id', 56 | 'queue' => 'your-queue-name', 57 | 'region' => 'us-east-1', 58 | ], 59 | 60 | 'redis' => [ 61 | 'driver' => 'redis', 62 | 'connection' => 'default', 63 | 'queue' => 'default', 64 | 'retry_after' => 90, 65 | ], 66 | 67 | ], 68 | 69 | /* 70 | |-------------------------------------------------------------------------- 71 | | Failed Queue Jobs 72 | |-------------------------------------------------------------------------- 73 | | 74 | | These options configure the behavior of failed queue job logging so you 75 | | can control which database and table are used to store the jobs that 76 | | have failed. You may change them to any database / table you wish. 77 | | 78 | */ 79 | 80 | 'failed' => [ 81 | 'database' => env('DB_CONNECTION', 'mysql'), 82 | 'table' => 'failed_jobs', 83 | ], 84 | 85 | ]; 86 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | ], 21 | 22 | 'ses' => [ 23 | 'key' => env('SES_KEY'), 24 | 'secret' => env('SES_SECRET'), 25 | 'region' => 'us-east-1', 26 | ], 27 | 28 | 'sparkpost' => [ 29 | 'secret' => env('SPARKPOST_SECRET'), 30 | ], 31 | 32 | 'stripe' => [ 33 | 'model' => App\User::class, 34 | 'key' => env('STRIPE_KEY'), 35 | 'secret' => env('STRIPE_SECRET'), 36 | ], 37 | 38 | ]; 39 | -------------------------------------------------------------------------------- /config/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' => 'laravel_session', 126 | 127 | /* 128 | |-------------------------------------------------------------------------- 129 | | Session Cookie Path 130 | |-------------------------------------------------------------------------- 131 | | 132 | | The session cookie path determines the path for which the cookie will 133 | | be regarded as available. Typically, this will be the root path of 134 | | your application but you are free to change this when necessary. 135 | | 136 | */ 137 | 138 | 'path' => '/', 139 | 140 | /* 141 | |-------------------------------------------------------------------------- 142 | | Session Cookie Domain 143 | |-------------------------------------------------------------------------- 144 | | 145 | | Here you may change the domain of the cookie used to identify a session 146 | | in your application. This will determine which domains the cookie is 147 | | available to in your application. A sensible default has been set. 148 | | 149 | */ 150 | 151 | 'domain' => env('SESSION_DOMAIN', null), 152 | 153 | /* 154 | |-------------------------------------------------------------------------- 155 | | HTTPS Only Cookies 156 | |-------------------------------------------------------------------------- 157 | | 158 | | By setting this option to true, session cookies will only be sent back 159 | | to the server if the browser has a HTTPS connection. This will keep 160 | | the cookie from being sent to you if it can not be done securely. 161 | | 162 | */ 163 | 164 | 'secure' => env('SESSION_SECURE_COOKIE', false), 165 | 166 | /* 167 | |-------------------------------------------------------------------------- 168 | | HTTP Access Only 169 | |-------------------------------------------------------------------------- 170 | | 171 | | Setting this value to true will prevent JavaScript from accessing the 172 | | value of the cookie and the cookie will only be accessible through 173 | | the HTTP protocol. You are free to modify this option if needed. 174 | | 175 | */ 176 | 177 | 'http_only' => true, 178 | 179 | ]; 180 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | -------------------------------------------------------------------------------- /database/factories/ModelFactory.php: -------------------------------------------------------------------------------- 1 | define(App\User::class, function (Faker\Generator $faker) { 16 | static $password; 17 | 18 | return [ 19 | 'name' => $faker->name, 20 | 'email' => $faker->unique()->safeEmail, 21 | 'password' => $password ?: $password = bcrypt('secret'), 22 | 'remember_token' => str_random(10), 23 | ]; 24 | }); 25 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('name'); 19 | $table->string('email')->unique(); 20 | $table->string('password'); 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 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_100000_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email')->index(); 18 | $table->string('token'); 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 | -------------------------------------------------------------------------------- /database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call(UsersTableSeeder::class); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /docs/angular/another_app.md: -------------------------------------------------------------------------------- 1 | ## Making Another Angular App 2 | 3 | For this example name of the new Angular app will be `StockManagement`. 4 | 5 | First **cd** to `angular` directory and run 6 | 7 | ``` 8 | ng new StockManagement 9 | cd StockManagement 10 | ``` 11 | 12 | Than run 13 | 14 | ``` 15 | ng eject 16 | ``` 17 | 18 | This command will generate `webpack.config.js` file in `StockManagement`. 19 | Delete it, other config files will be used. 20 | 21 | Open `.angular-cli.json` and change `ejected` value from `true` to `false` 22 | 23 | ``` 24 | "project": { 25 | "name": "StockManagement", 26 | "ejected": false 27 | }, 28 | ``` 29 | 30 | Install new packages with 31 | 32 | ``` 33 | npm install 34 | ``` 35 | 36 | You will need `clean-webpack-plugin` for production bundling so install that as well 37 | 38 | ``` 39 | npm install clean-webpack-plugin --save-dev 40 | ``` 41 | 42 | Copy three config files `angular/webpack_config/base/base.config.js`, `angular/webpack_config/dev/dev.config.js` and `angular/webpack_config/prod/prod.config.js` to your app root, e.g. `angular/StockManagement`. 43 | 44 | That's it start making your app using all the benefits of **angular-cli** tool, build it, test it with `ng serve` and so on. 45 | 46 | When you are ready to integrate it into Laravel make a route to it in `routes/web.php`, something like this: 47 | 48 | ```php 49 | Route::get('stock/handling/{path?}', function () { 50 | return view('StockManagement'); 51 | })->where('path', '.*') 52 | ->name('stock_manage'); 53 | ``` 54 | 55 | Do not create view file as it will be generated from the template but let the name of view be the same as the application name, in this case `StockManagement`. 56 | 57 | Next create template file called `laravel-ng-template.html` in `angular/StockManagement/src`. 58 | 59 | Here is some minimal setup but you can add more `html`, `php` and/or Laravel blade syntax in this file. 60 | 61 | **`angular/StockManagement/src/laravel-ng-template.html`** 62 | 63 | ```html 64 | 65 | 66 | 67 | 68 | Stock Management 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | ``` 79 | 80 | ## Packaging 81 | 82 | To package for development use `npm run build`. 83 | This will produce bundle suitable for the development i.e. files are not minified, source map files are generated etc... 84 | 85 | For the production packing use `npm run build-prod`. 86 | This will produce bundle suitable for the production i.e. files are minified, no source map files, license generated, hashing is used in generated bundles names etc... 87 | 88 | After running one of these commands there will be a new folder `StockManagement` in `public` and a new blade file `StockManagement.blade.php` in `resources/views`. 89 | Generated blade file will have all the necessary links to generated bundles. 90 | 91 | ## Entering Into Angular App 92 | 93 | Make a link somewhere on your site to enter in your new app. 94 | I have used `stock_manage` as a route name so in this case link would be 95 | 96 | ```php 97 | Stock 98 | ``` 99 | 100 | Than you can continue to develop your app as a standalone using `ng` tool. You can start it in the browser as a standalone using `ng serve` on `http://localhost:4200/` and at the same time you can serve entire Laravel application on other port e.g. `http://localhost:8000/` with `php artisan serve`. 101 | Once you are ready to deploy new changes into Laravel run `npm run build` for `dev` packaging or `npm run build-prod` for `prod` packaging. 102 | 103 | Every time you run one of these build commands `StockManagement` app in Laravel `public` directory will be re-created and also view file `resources/views/StockManagement.blade.php` will be re-created as well. 104 | -------------------------------------------------------------------------------- /docs/angular/integration.md: -------------------------------------------------------------------------------- 1 | ## Integrating Angular Applications into Laravel 2 | 3 | This document details how you integrate Angular applications built with **angular-cli** into Laravel. 4 | 5 | All of the Angular apps you build go into `angular` directory in your Laravel project root folder. 6 | 7 | In `angular` folder there are two demo apps, `app1` and `app2`. 8 | Change current working directory to the Angular application you want to work on e.g. 9 | 10 | ``` 11 | cd ./angular/app1 12 | ``` 13 | 14 | Run `npm install` and than you develop Angular app with **angular-cli** just as you do normally without thinking of any integration. 15 | You use `ng g module`, `ng serve`, `ng build`, etc... 16 | 17 | After you run and test Angular app as a standalone you can easily integrate it into Laravel by following steps below. 18 | 19 | ## Integration Steps 20 | 21 | **Note:** For the two demo Angular apps that come with this project, `angular/app1` and `angular/app2` integration steps below are already made. 22 | 23 | First create a route in `routes/web.php` which will lead to the app. 24 | Route should look like this: 25 | 26 | ```php 27 | Route::get('your/ngpath/{path?}', function () { 28 | return view('app1'); 29 | })->where('path', '.*') 30 | ->name('ng_app1'); 31 | ``` 32 | 33 | Follow the convention and let the name of the view file be the same as the root folder of your Angular app e.g. `app1`, you can change that later if you want. 34 | Do not create view file just define route. 35 | 36 | Next in the `angular/app1/src/laravel-ng-template.html` put all the code you want your entry page to have. 37 | 38 | **`angular/app1/src/laravel-ng-template.html`** 39 | 40 | ```html 41 | 42 | 43 | 44 | 45 | Angular App One 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | ``` 57 | 58 | + `` - this line dynamically sets proper base URL using route name. This allows for later changes of route path in the `routes/web.php` without the need to edit anything else. 59 | 60 | + Application will be in `public` directory so to reference any files in the template like `favicon.ico` precede it with app folder name beginning with `/` e.g. `/app1/favicon.ico`. 61 | Don't reference external `.js`, `.css` files and assets directly in the template, instead point to them in `.angular-cli.json` file in `apps[].scripts`, `apps[].styles` and `apps[].assets` sections respectively, this way they will be bundled. 62 | 63 | + `` - root selector of your Angular app, you can change it if you are using some other name. 64 | 65 | You can put Laravel blade code and even PHP code in this file if you need to. 66 | 67 | ## Bundling for `dev` or `prod` 68 | 69 | From your Angular app root directory (`angular/app1` in this case) for the `development` build run 70 | 71 | ``` 72 | npm run build 73 | ``` 74 | 75 | and for the `production` build run 76 | 77 | ``` 78 | npm run build-prod 79 | ``` 80 | 81 | Both these commands will pack app suitable for `dev` or `prod` bundles and deploy it into Laravel `public` directory. 82 | Blade view in `resources/views` will be created based on your Angular app root folder name, in this case `app1.blade.php` file will be created. 83 | 84 | Generated blade file will have all of your code you have put in `angular/app1/src/laravel-ng-template.html` plus all of the needed includes of generated bundled files in ` 24 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 "node_modules/bootstrap-sass/assets/stylesheets/bootstrap"; 10 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /resources/lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | 86 | 93 |
94 |
95 | 96 | 97 | -------------------------------------------------------------------------------- /routes/api.php: -------------------------------------------------------------------------------- 1 | get('/user', function (Request $request) { 17 | return $request->user(); 18 | }); 19 | -------------------------------------------------------------------------------- /routes/channels.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 16 | }); 17 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 18 | })->describe('Display an inspiring quote'); 19 | -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | '): so we have named route, that way if we change routes we don't have to change files. 17 | // - where('path', '.*'): use regex for optional 'path' that will ignore the rest of the URI 18 | // so Laravel doesn't get in the way of passing routes to Angular. 19 | 20 | Route::get('ngcli/app1/{path?}', function () { 21 | return view('app1'); 22 | })->where('path', '.*') 23 | ->name('ng_app1'); 24 | 25 | Route::get('ngcli/app2/{path?}', function () { 26 | return view('app2'); 27 | })->where('path', '.*') 28 | ->name('ng_app2'); 29 | 30 | // Default route. 31 | Route::get('/', function () { 32 | return view('welcome'); 33 | }); 34 | -------------------------------------------------------------------------------- /server.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 | -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/.gitignore: -------------------------------------------------------------------------------- 1 | config.php 2 | routes.php 3 | schedule-* 4 | compiled.php 5 | services.json 6 | events.scanned.php 7 | routes.scanned.php 8 | down 9 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/testing/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /tests/CreatesApplication.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 19 | 20 | return $app; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 20 | 21 | $response->assertStatus(200); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /webpack.mix.js: -------------------------------------------------------------------------------- 1 | const { 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 | --------------------------------------------------------------------------------