Skip to content

Commit d9a5e0b

Browse files
author
Jad Joubran
committed
artisan generator for new config
1 parent 514544d commit d9a5e0b

File tree

6 files changed

+63
-5
lines changed

6 files changed

+63
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
## Changelog
1+
artisan ## Changelog
22

33
### v2.6.2
44
+ fixed elixir watcher for less
55
+ artisan generator for creating a new service **artisan ng:service name**
66
+ artisan generator for creating a new filter **artisan ng:filter name**
7+
+ artisan generator for creating a new config **artisan ng:config name**
78

89
### v2.6.1
910
+ updated bower dependencies (angular material released 0.10.1)

angular/config/theme.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
(function(){
22
"use strict";
33

4-
angular.module('app.config').config( function($mdThemingProvider) {
4+
angular.module('app.config').config(function($mdThemingProvider) {
55
/* For more info, visit https://material.angularjs.org/#/Theming/01_introduction */
66
$mdThemingProvider.theme('default')
77
.primaryPalette('indigo')
88
.accentPalette('grey')
99
.warnPalette('red');
1010
});
1111

12-
})();
12+
})();
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
3+
namespace App\Console\Commands;
4+
5+
use Illuminate\Console\Command;
6+
use File;
7+
8+
class AngularConfig extends Command
9+
{
10+
/**
11+
* The name and signature of the console command.
12+
* @var string
13+
*/
14+
protected $signature = 'ng:config {name}';
15+
16+
/**
17+
* The console command description.
18+
* @var string
19+
*/
20+
protected $description = 'Create a new config inside the angular/config folder.';
21+
22+
/**
23+
* Create a new command instance.
24+
* @return void
25+
*/
26+
public function __construct()
27+
{
28+
parent::__construct();
29+
}
30+
31+
/**
32+
* Execute the console command.
33+
* @return mixed
34+
*/
35+
public function handle()
36+
{
37+
$name = $this->argument('name');
38+
39+
$js = file_get_contents(__DIR__.'/Stubs/AngularConfig/config.js.stub');
40+
41+
$folder = __DIR__.'/../../../angular/config/';
42+
43+
//create config (.js)
44+
File::put($folder.'/'.$name.'.js', $js);
45+
46+
$this->info('Config created successfully.');
47+
}
48+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
(function(){
2+
"use strict";
3+
4+
angular.module('app.config').config(function(){
5+
//
6+
});
7+
8+
})();

app/Console/Kernel.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class Kernel extends ConsoleKernel
1818
'App\Console\Commands\AngularDialog',
1919
'App\Console\Commands\AngularService',
2020
'App\Console\Commands\AngularFilter',
21+
'App\Console\Commands\AngularConfig',
2122
];
2223

2324
/**

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Here are the goodies that you'll get:
2121
* Angular
2222
* Angular Material
2323
* Elixir 3.0
24+
* artisan generatores for angular (artisan ng:feature name, artisan ng:dialog name, etc..)
2425
* [JWT auth](https://scotch.io/tutorials/token-based-authentication-for-angularjs-and-laravel-apps)
2526
* Laravel [DebugBar](https://github.com/barryvdh/laravel-debugbar)
2627
* Angular [UI router](https://github.com/angular-ui/ui-router)
@@ -54,11 +55,10 @@ Open a new issue, I'd love to help.
5455
## Planned features
5556

5657

57-
- artisan generators for config + update overview
5858
- simplify gulpfile using elixir.json
5959
- custom elixir task: make jshint optional
6060
- Migrate to open source hosting
61-
- New demo pages: Toasts, Dialogs, Unsupported Browser, generators, Elixir, Rest API, loading bar, debugbar, filters, JWT
61+
- New demo pages: Toasts, Dialogs, Unsupported Browser, artisan angular generators, Elixir, Rest API, loading bar, debugbar, filters, JWT
6262
- make gulp --production part of the automated release
6363
- make readme more appealing
6464
- jwt auth example (with seed) + route authentication

0 commit comments

Comments
 (0)