Skip to content

Commit 5ed6022

Browse files
committed
Laravel - Angular integration
This system provides build tools and documentation for developing and integrating one or more Angular applications in Laravel project.
0 parents  commit 5ed6022

File tree

117 files changed

+64087
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+64087
-0
lines changed

.env.example

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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=

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
* text=auto
2+
*.css linguist-vendored
3+
*.scss linguist-vendored
4+
*.js linguist-vendored
5+
CHANGELOG.md export-ignore

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/node_modules
2+
/public/hot
3+
/public/storage
4+
/public/Ng
5+
/storage/*.key
6+
/vendor
7+
/.idea
8+
/.vagrant
9+
Homestead.json
10+
Homestead.yaml
11+
npm-debug.log
12+
.env

LICENSE

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2017 Toni Romic ([email protected])
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.

README.md

Lines changed: 502 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { NgModule } from '@angular/core';
2+
import { Routes, RouterModule } from '@angular/router';
3+
4+
import { TestRoutingComponent } from './test-routing.component';
5+
6+
export const routes: Routes = [
7+
{ path: 'eager/load', component: TestRoutingComponent},
8+
{ path: 'lazy/load', loadChildren: 'app/lazyload_route/lazyload.module#LazyloadModule' },
9+
];
10+
11+
@NgModule({
12+
imports: [RouterModule.forRoot(routes)],
13+
exports: [RouterModule]
14+
})
15+
export class AppRoutingModule {}

angular_apps/App1/app.component.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app1',
5+
template: `
6+
Hello <span class="ng">Angular</span> from <span class="L">Laravel</span>, looks like it works...
7+
<p><mm></mm></p>
8+
<ul>
9+
<li><a routerLink="/eager/load" routerLinkActive="active">Click to test eagerly loaded route</a></li>
10+
<li><a routerLink="/lazy/load" routerLinkActive="active">Click to test lazy loaded route</a></li>
11+
</ul>
12+
<router-outlet></router-outlet>
13+
`
14+
})
15+
export class AppComponent {}

angular_apps/App1/app.module.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { NgModule } from '@angular/core';
2+
import { BrowserModule } from '@angular/platform-browser';
3+
4+
/* App Root */
5+
import { AppComponent } from './app.component';
6+
7+
import { MotivationComponent } from './motivations/startAppMotivation.component';
8+
import { TestRoutingComponent } from './test-routing.component';
9+
10+
/* Routing Module */
11+
import { AppRoutingModule } from './app-routing.module';
12+
13+
@NgModule({
14+
imports: [
15+
BrowserModule,
16+
AppRoutingModule
17+
],
18+
19+
declarations: [ AppComponent, MotivationComponent, TestRoutingComponent ],
20+
bootstrap: [ AppComponent ]
21+
})
22+
export class AppModule {}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { NgModule } from '@angular/core';
2+
import { Routes, RouterModule } from '@angular/router';
3+
4+
import { LazyloadTestComponent } from './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 {}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Component} from '@angular/core';
2+
3+
@Component({
4+
template: `
5+
<h3>First App Route Test</h3>
6+
<div>
7+
Lazy load routing test for App 1.
8+
</div>
9+
`
10+
})
11+
export class LazyloadTestComponent {}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { NgModule } from '@angular/core';
2+
3+
import { LazyloadTestComponent } from './lazyload-test.component';
4+
5+
import { LazyloadRoutingModule } from './lazyload-routing.module';
6+
7+
@NgModule({
8+
imports: [ LazyloadRoutingModule ],
9+
declarations: [ LazyloadTestComponent ],
10+
})
11+
export class LazyloadModule {}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
selector: 'mm',
5+
template: `
6+
<div><b>Start building your App 1!</b></div>
7+
`
8+
})
9+
export class MotivationComponent {}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
template: `
5+
<h3>App 1 Eager Routing Test</h3>
6+
<div>
7+
We are eagerly routed here
8+
</div>
9+
`,
10+
})
11+
export class TestRoutingComponent { }
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { NgModule } from '@angular/core';
2+
import { Routes, RouterModule } from '@angular/router';
3+
4+
import { TestRoutingComponent } from './test-routing.component';
5+
6+
export const routes: Routes = [
7+
{ path: 'eager/load', component: TestRoutingComponent},
8+
{ path: 'lazy/load', loadChildren: 'app/lazyload_route/lazyload.module#LazyloadModule' },
9+
];
10+
11+
@NgModule({
12+
imports: [RouterModule.forRoot(routes)],
13+
exports: [RouterModule]
14+
})
15+
export class AppRoutingModule {}

angular_apps/App2/app.component.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app2',
5+
template: `
6+
Hello <span class="ng">Angular</span> from <span class="L">Laravel</span>, looks like the second app works...
7+
<p><mm></mm></p>
8+
<ul>
9+
<li><a routerLink="/eager/load" routerLinkActive="active">Click to test eagerly loaded route</a></li>
10+
<li><a routerLink="/lazy/load" routerLinkActive="active">Click to test lazy loaded route</a></li>
11+
</ul>
12+
<router-outlet></router-outlet>
13+
`
14+
})
15+
export class AppComponent {}

angular_apps/App2/app.module.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { NgModule } from '@angular/core';
2+
import { BrowserModule } from '@angular/platform-browser';
3+
4+
/* App Root */
5+
import { AppComponent } from './app.component';
6+
7+
import { MotivationComponent } from './motivations/startAppMotivation.component';
8+
import { TestRoutingComponent } from './test-routing.component';
9+
10+
/* Routing Module */
11+
import { AppRoutingModule } from './app-routing.module';
12+
13+
@NgModule({
14+
imports: [
15+
BrowserModule,
16+
AppRoutingModule
17+
],
18+
19+
declarations: [ AppComponent, MotivationComponent, TestRoutingComponent ],
20+
bootstrap: [ AppComponent ]
21+
})
22+
export class AppModule {}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { NgModule } from '@angular/core';
2+
import { Routes, RouterModule } from '@angular/router';
3+
4+
import { LazyloadTestComponent } from './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 {}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Component} from '@angular/core';
2+
3+
@Component({
4+
template: `
5+
<h3>Second App Route Test</h3>
6+
<div>
7+
Lazy load routing test for App 2.
8+
</div>
9+
`
10+
})
11+
export class LazyloadTestComponent {}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { NgModule } from '@angular/core';
2+
3+
import { LazyloadTestComponent } from './lazyload-test.component';
4+
5+
import { LazyloadRoutingModule } from './lazyload-routing.module';
6+
7+
@NgModule({
8+
imports: [ LazyloadRoutingModule ],
9+
declarations: [ LazyloadTestComponent ],
10+
})
11+
export class LazyloadModule {}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
selector: 'mm',
5+
template: `
6+
<div><b>Enjoy making cool App 2!</b></div>
7+
`
8+
})
9+
export class MotivationComponent {}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
template: `
5+
<h3>App 2 Eager Routing Test</h3>
6+
<div>
7+
We are eagerly routed here
8+
</div>
9+
`,
10+
})
11+
export class TestRoutingComponent { }

angular_apps/config/app1.config.js

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/**
2+
* System configuration for Angular samples
3+
* Adjust as necessary for your application needs.
4+
*/
5+
(function (global) {
6+
System.config({
7+
paths: {
8+
// paths serve as alias
9+
'npm:': '/Ng/'
10+
},
11+
// map tells the System loader where to look for things
12+
map: {
13+
// our app is within the App1 folder
14+
'app': '/App1',
15+
16+
// angular bundles
17+
'@angular/animations': 'npm:@angular/animations/bundles/animations.umd.js',
18+
'@angular/animations/browser': 'npm:@angular/animations/bundles/animations-browser.umd.js',
19+
'@angular/core': 'npm:@angular/core/bundles/core.umd.js',
20+
'@angular/common': 'npm:@angular/common/bundles/common.umd.js',
21+
'@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
22+
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
23+
'@angular/platform-browser/animations': 'npm:@angular/platform-browser/bundles/platform-browser-animations.umd.js',
24+
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
25+
'@angular/http': 'npm:@angular/http/bundles/http.umd.js',
26+
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
27+
'@angular/router/upgrade': 'npm:@angular/router/bundles/router-upgrade.umd.js',
28+
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
29+
'@angular/upgrade': 'npm:@angular/upgrade/bundles/upgrade.umd.js',
30+
'@angular/upgrade/static': 'npm:@angular/upgrade/bundles/upgrade-static.umd.js',
31+
32+
// other libraries
33+
'rxjs': 'npm:rxjs',
34+
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js'
35+
},
36+
// packages tells the System loader how to load when no filename and/or no extension
37+
packages: {
38+
app: {
39+
main: './main.js',
40+
defaultExtension: 'js',
41+
meta: {
42+
'./*.js': {
43+
loader: '/systemjs-angular-loader.js'
44+
}
45+
}
46+
},
47+
rxjs: {
48+
defaultExtension: 'js'
49+
}
50+
}
51+
});
52+
})(this);

0 commit comments

Comments
 (0)