Skip to content

Instantly share code, notes, and snippets.

@nulpatrol
Created June 15, 2018 14:58
Show Gist options
  • Save nulpatrol/60161b029e8409f044d4d2d481252983 to your computer and use it in GitHub Desktop.
Save nulpatrol/60161b029e8409f044d4d2d481252983 to your computer and use it in GitHub Desktop.
<?php
namespace Illuminate\Foundation\Console\Presets;
class Bootstrap extends Preset
{
/**
* Install the preset.
*
* @return void
*/
public static function install($dev = true)
{
static::updatePackages($dev);
static::updateSass();
static::removeNodeModules();
}
/**
* Update the given package array.
*
* @param array $packages
* @return array
*/
protected static function updatePackageArray(array $packages)
{
return [
'bootstrap' => '^4.0.0',
'jquery' => '^3.2',
'popper.js' => '^1.12',
] + $packages;
}
/**
* Update the Sass files for the application.
*
* @return void
*/
protected static function updateSass()
{
copy(__DIR__.'/bootstrap-stubs/_variables.scss', resource_path('assets/sass/_variables.scss'));
copy(__DIR__.'/bootstrap-stubs/app.scss', resource_path('assets/sass/app.scss'));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment