Skip to content
This repository was archived by the owner on Jun 22, 2022. It is now read-only.

Commit 75731bc

Browse files
committed
feat: Laravel 8 support added
1 parent 5415546 commit 75731bc

File tree

4 files changed

+47
-15
lines changed

4 files changed

+47
-15
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
.idea
22
/vendor/
3-
composer.lock
3+
composer.lock
4+
.DS_Store
5+
**/.DS_Store

composer.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.2.5",
20-
"illuminate/support": "^7.0",
21-
"infyomlabs/laravel-generator-helpers": "^2.0",
22-
"laravel/ui": "^2.0"
19+
"php": "^7.3",
20+
"illuminate/support": "^8.0",
21+
"infyomlabs/laravel-generator-helpers": "^3.0",
22+
"laravel/ui": "^3.0"
2323
},
2424
"autoload": {
2525
"psr-4": {

coreui-stubs/bootstrap/webpack.mix.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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/js/app.js', 'public/js')
15+
.sass('resources/sass/app.scss', 'public/css');

src/CoreUIPreset.php

+25-10
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,20 @@ public function __construct(Command $command)
3030
protected static function updatePackageArray(array $packages)
3131
{
3232
return [
33-
'bootstrap' => '^4.1.0',
34-
'jquery' => '^3.2',
35-
'popper.js' => '^1.12',
36-
'@coreui/coreui' => '^3.2.2',
37-
'@coreui/icons' => '^1.0.1',
38-
] + $packages;
33+
'bootstrap' => '^4.1.0',
34+
'jquery' => '^3.2',
35+
'popper.js' => '^1.12',
36+
'sass' => '^1.15.2',
37+
'sass-loader' => '^8.0.0',
38+
'@coreui/coreui' => '^3.2.2',
39+
'@coreui/icons' => '^1.0.1',
40+
] + $packages;
3941
}
4042

4143
public function install()
4244
{
4345
static::updatePackages();
46+
static::updateWebpackConfiguration();
4447
static::updateSass();
4548
static::updateBootstrapping();
4649
static::removeNodeModules();
@@ -53,7 +56,19 @@ public function install()
5356
*/
5457
protected static function updateSass()
5558
{
56-
copy(__DIR__.'/../coreui-stubs/bootstrap/app.scss', resource_path('sass/app.scss'));
59+
(new Filesystem())->ensureDirectoryExists(resource_path('sass'));
60+
61+
copy(__DIR__ . '/../coreui-stubs/bootstrap/app.scss', resource_path('sass/app.scss'));
62+
}
63+
64+
/**
65+
* Update the Webpack configuration.
66+
*
67+
* @return void
68+
*/
69+
protected static function updateWebpackConfiguration()
70+
{
71+
copy(__DIR__ . '/../adminlte-stubs/bootstrap/webpack.mix.js', base_path('webpack.mix.js'));
5772
}
5873

5974
/**
@@ -63,8 +78,8 @@ protected static function updateSass()
6378
*/
6479
protected static function updateBootstrapping()
6580
{
66-
copy(__DIR__.'/../coreui-stubs/bootstrap/bootstrap.js', resource_path('js/bootstrap.js'));
67-
copy(__DIR__.'/../coreui-stubs/bootstrap/app.js', resource_path('js/app.js'));
81+
copy(__DIR__ . '/../coreui-stubs/bootstrap/bootstrap.js', resource_path('js/bootstrap.js'));
82+
copy(__DIR__ . '/../coreui-stubs/bootstrap/app.js', resource_path('js/app.js'));
6883
}
6984

7085
public function installAuth()
@@ -115,7 +130,7 @@ protected function scaffoldAuth()
115130

116131
file_put_contents(
117132
base_path('routes/web.php'),
118-
"Auth::routes();\n\nRoute::get('/home', 'HomeController@index')->name('home');\n\n",
133+
"Auth::routes();\n\nRoute::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');\n\n",
119134
FILE_APPEND
120135
);
121136

0 commit comments

Comments
 (0)