Skip to content

Commit

Permalink
Update for Laravel 7.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Wiser committed May 7, 2020
1 parent c5fd64c commit c6f97ab
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Use this repo as a skeleton for your new preset, once you're done please open an issue on [this repo](https://github.com/laravel-frontend-presets/internals).

Here's the latest documentation on Laravel 5.5:
Here's the latest documentation on Laravel 7.x:

https://laravel.com/docs/master/

Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "laravel-frontend-presets/skeleton",
"description": "Laravel 5.5.x Front-end preset for skeleton",
"description": "Laravel 7.x Front-end preset for skeleton",
"keywords": ["laravel", "preset", "skeleton"],
"license": "MIT",
"require": {
"laravel/framework": "5.5.*"
"laravel/framework": "^7.0",
"laravel/ui": "^2.0"
},
"autoload": {
"psr-4": {
Expand Down
10 changes: 5 additions & 5 deletions src/SkeletonPreset.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ protected static function updatePackageArray(array $packages)
protected static function updateSass()
{
// clean up all the files in the sass folder
$orphan_sass_files = glob(resource_path('/assets/sass/*.*'));
$orphan_sass_files = glob(resource_path('/sass/*.*'));

foreach($orphan_sass_files as $sass_file)
{
(new Filesystem)->delete($sass_file);
}

// copy files from the stubs folder
copy(__DIR__.'/skeleton-stubs/app.scss', resource_path('assets/sass/app.scss'));
copy(__DIR__.'/skeleton-stubs/app.scss', resource_path('sass/app.scss'));
}

/**
Expand All @@ -78,7 +78,7 @@ protected static function updateBootstrapping()
);

// copy a new bootstrap.js file from your stubs folder
copy(__DIR__.'/skeleton-stubs/bootstrap.js', resource_path('assets/js/bootstrap.js'));
copy(__DIR__.'/skeleton-stubs/bootstrap.js', resource_path('js/bootstrap.js'));
}

/**
Expand All @@ -105,13 +105,13 @@ protected static function updateWelcomePage()
protected static function addAuthTemplates()
{
// Add Home controller
copy(__DIR__.'/stubs-stubs/Controllers/HomeController.php', app_path('Http/Controllers/HomeController.php'));
copy(__DIR__.'/skeleton-stubs/Controllers/HomeController.php', app_path('Http/Controllers/HomeController.php'));

// Add Auth routes in 'routes/web.php'
$auth_route_entry = "Auth::routes();\n\nRoute::get('/home', 'HomeController@index')->name('home');\n\n";
file_put_contents('./routes/web.php', $auth_route_entry, FILE_APPEND);

// Copy Skeleton auth views from the stubs folder
(new Filesystem)->copyDirectory(__DIR__.'/foundation-stubs/views', resource_path('views'));
(new Filesystem)->copyDirectory(__DIR__.'/skeleton-stubs/views', resource_path('views'));
}
}
6 changes: 3 additions & 3 deletions src/SkeletonPresetServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
namespace LaravelFrontendPresets\SkeletonPreset;

use Illuminate\Support\ServiceProvider;
use Illuminate\Foundation\Console\PresetCommand;
use Laravel\Ui\UiCommand;

class SkeletonPresetServiceProvider extends ServiceProvider
{
Expand All @@ -13,13 +13,13 @@ class SkeletonPresetServiceProvider extends ServiceProvider
*/
public function boot()
{
PresetCommand::macro('skeleton', function ($command) {
UiCommand::macro('skeleton', function ($command) {
SkeletonPreset::install(false);
$command->info('Skeleton scaffolding installed successfully.');
$command->comment('Please run "npm install && npm run dev" to compile your fresh scaffolding.');
});

PresetCommand::macro('skeleton-auth', function ($command) { //optional
UiCommand::macro('skeleton-auth', function ($command) { //optional
SkeletonPreset::install(true);
$command->info('Skeleton scaffolding with Auth views installed successfully.');
$command->comment('Please run "npm install && npm run dev" to compile your fresh scaffolding.');
Expand Down

0 comments on commit c6f97ab

Please sign in to comment.