Skip to content

Commit 9d57647

Browse files
committed
fix: Laravel 8 related fixes made
1 parent 37ff1ed commit 9d57647

File tree

2 files changed

+36
-6
lines changed

2 files changed

+36
-6
lines changed
Lines changed: 15 additions & 0 deletions
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/AdminLTEPreset.php

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,28 +30,43 @@ public function __construct(Command $command)
3030
protected static function updatePackageArray(array $packages)
3131
{
3232
return [
33-
'bootstrap' => '^4.0.0',
34-
'jquery' => '^3.2',
35-
'popper.js' => '^1.12',
36-
'admin-lte' => '^3.0',
37-
] + $packages;
33+
'bootstrap' => '^4.0.0',
34+
'jquery' => '^3.2',
35+
'popper.js' => '^1.12',
36+
'admin-lte' => '^3.0',
37+
'sass' => '^1.15.2',
38+
'sass-loader' => '^8.0.0',
39+
] + $packages;
3840
}
3941

4042
public function install()
4143
{
4244
static::updatePackages();
45+
static::updateWebpackConfiguration();
4346
static::updateSass();
4447
static::updateBootstrapping();
4548
static::removeNodeModules();
4649
}
4750

51+
/**
52+
* Update the Webpack configuration.
53+
*
54+
* @return void
55+
*/
56+
protected static function updateWebpackConfiguration()
57+
{
58+
copy(__DIR__.'/../adminlte-stubs/bootstrap/webpack.mix.js', base_path('webpack.mix.js'));
59+
}
60+
4861
/**
4962
* Update the Sass files for the application.
5063
*
5164
* @return void
5265
*/
5366
protected static function updateSass()
5467
{
68+
(new Filesystem)->ensureDirectoryExists(resource_path('sass'));
69+
5570
copy(__DIR__.'/../adminlte-stubs/bootstrap/_variables.scss', resource_path('sass/_variables.scss'));
5671
copy(__DIR__.'/../adminlte-stubs/bootstrap/app.scss', resource_path('sass/app.scss'));
5772
}
@@ -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)