Skip to content

Commit afa39c1

Browse files
New free version
1 parent c69b68b commit afa39c1

File tree

106 files changed

+12405
-1428
lines changed

Some content is hidden

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

106 files changed

+12405
-1428
lines changed

src/NowUIPresetServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class NowUiPresetServiceProvider extends ServiceProvider
1515
public function boot()
1616
{
1717
PresetCommand::macro('nowui', function ($command) {
18-
ArgonPreset::install();
18+
NowUiPreset::install();
1919

2020
$command->info('Now Ui scaffolding installed successfully.');
2121
});

src/NowUiPreset.php

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
use Illuminate\Filesystem\Filesystem;
66
use Illuminate\Foundation\Console\Presets\Preset;
77

8-
class NowUIPreset extends Preset
8+
class NowUiPreset extends Preset
99
{
10-
const STUBSPATH = __DIR__.'/nowui-stubs/';
10+
const STUBSPATH = __DIR__.'/now-ui-stubs/';
1111

1212
/**
1313
* Install the preset.
@@ -16,15 +16,17 @@ class NowUIPreset extends Preset
1616
*/
1717
public static function install()
1818
{
19-
static::updatePackages();
20-
static::updateAssets();
19+
static::updatePackages();
20+
static::updateAssets();
2121

2222
static::updateWelcomePage();
2323
static::updateAuthViews();
2424
static::updateLayoutViews();
2525
static::updateDashboardPage();
2626

2727
static::addUserManagement();
28+
29+
static::addAlerts();
2830

2931
// static::removeNodeModules();
3032
}
@@ -47,7 +49,7 @@ protected static function updatePackageArray(array $packages)
4749
*/
4850
protected static function updateAssets()
4951
{
50-
static::copyDirectory('resources/assets', public_path('nowui'));
52+
static::copyDirectory('resources/assets', public_path('assets'));
5153
}
5254

5355
/**
@@ -72,10 +74,10 @@ protected static function updateWelcomePage()
7274
protected static function updateDashboardPage()
7375
{
7476
// remove default welcome page
75-
static::deleteResource(('views/dashboard.blade.php'));
77+
static::deleteResource(('views/home.blade.php'));
7678

7779
// copy new one from your stubs folder
78-
static::copyFile('resources/views/dashboard.blade.php', resource_path('views/dashboard.blade.php'));
80+
static::copyFile('resources/views/home.blade.php', resource_path('views/home.blade.php'));
7981
}
8082

8183
/**
@@ -87,6 +89,7 @@ protected static function updateLayoutViews()
8789
{
8890
// copy new one from your stubs folder
8991
static::copyDirectory('resources/views/layouts', resource_path('views/layouts'));
92+
static::copyDirectory('resources/views/pages', resource_path('views/pages'));
9093
}
9194

9295
/**
@@ -98,19 +101,23 @@ protected static function updateAuthViews()
98101
{
99102
// Add Home controller
100103
static::copyFile('app/Http/Controllers/HomeController.php', app_path('Http/Controllers/HomeController.php'));
104+
static::copyFile('app/Http/Controllers/PageController.php', app_path('Http/Controllers/PageController.php'));
101105

102106
// Add Auth routes in 'routes/web.php'
103107
file_put_contents(
104-
'./routes/web.php',
105-
"Auth::routes();\n\nRoute::get('/home', 'HomeController@index')->name('home');\n\n",
108+
'./routes/web.php',
109+
"Auth::routes();\n\nRoute::get('/home', 'HomeController@index')->name('home');\n\n",
106110
FILE_APPEND
107111
);
108112

109-
// Copy argon auth views from the stubs folder
113+
// Copy now-ui auth views from the stubs folder
110114
static::deleteResource('views/home.blade.php');
111115
static::copyDirectory('resources/views/auth', resource_path('views/auth'));
112116
}
113-
117+
public static function addAlerts()
118+
{
119+
static::copyDirectory('resources/views/alerts', resource_path('views/alerts'));
120+
}
114121
/**
115122
* Copy user management and profile edit files
116123
*
@@ -120,6 +127,7 @@ public static function addUserManagement()
120127
{
121128
// Add seeder, controllers, requests and rules
122129
static::copyDirectory('database/seeds', app_path('../database/seeds'));
130+
static::copyDirectory('database/factories', app_path('../database/factories'));
123131

124132
static::copyFile('app/Http/Controllers/UserController.php', app_path('Http/Controllers/UserController.php'));
125133
static::copyFile('app/Http/Controllers/ProfileController.php', app_path('Http/Controllers/ProfileController.php'));
@@ -128,8 +136,8 @@ public static function addUserManagement()
128136

129137
// Add routes
130138
file_put_contents(
131-
'./routes/web.php',
132-
"Route::group(['middleware' => 'auth'], function () {\n\tRoute::resource('user', 'UserController', ['except' => ['show']]);\n\tRoute::get('profile', ['as' => 'profile.edit', 'uses' => 'ProfileController@edit']);\n\tRoute::put('profile', ['as' => 'profile.update', 'uses' => 'ProfileController@update']);\n\tRoute::put('profile/password', ['as' => 'profile.password', 'uses' => 'ProfileController@password']);\n});\n\n",
139+
'./routes/web.php',
140+
"Route::group(['middleware' => 'auth'], function () {\n\tRoute::resource('user', 'UserController', ['except' => ['show']]);\n\tRoute::get('profile', ['as' => 'profile.edit', 'uses' => 'ProfileController@edit']);\n\tRoute::put('profile', ['as' => 'profile.update', 'uses' => 'ProfileController@update']);\n\tRoute::put('profile/password', ['as' => 'profile.password', 'uses' => 'ProfileController@password']);\n\tRoute::get('{page}', ['as' => 'page.index', 'uses' => 'PageController@index']);\n});\n\n",
133141
FILE_APPEND
134142
);
135143

src/now-ui-stubs/app/Category.php

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/now-ui-stubs/app/Http/Controllers/CategoryController.php

Lines changed: 0 additions & 97 deletions
This file was deleted.

src/now-ui-stubs/app/Http/Controllers/ItemController.php

Lines changed: 0 additions & 120 deletions
This file was deleted.

0 commit comments

Comments
 (0)