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

Commit

Permalink
style: Apply fixes from StyleCI (#12)
Browse files Browse the repository at this point in the history
Co-authored-by: StyleCI Bot <[email protected]>
  • Loading branch information
mitulgolakiya and StyleCIBot authored Feb 22, 2022
1 parent aae3c48 commit 233a633
Showing 1 changed file with 22 additions and 25 deletions.
47 changes: 22 additions & 25 deletions src/StislaPreset.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use Laravel\Ui\Presets\Preset;
use Symfony\Component\Finder\SplFileInfo;


class StislaPreset extends Preset
{
/** @var Command */
Expand All @@ -27,30 +26,30 @@ public function __construct(Command $command, $isFortify = false)
/**
* Update the given package array.
*
* @param array $packages
* @param array $packages
*
* @return array
*/
protected static function updatePackageArray(array $packages, $configurationKey)
{
$stislaPackages = [
'dependencies' => [
"bootstrap" => "^4.0.0",
"jquery" => "^3.2",
"popper.js" => "^1.12",
"@fortawesome/fontawesome-free" => "^5.13.1",
"jquery.nicescroll" => "^3.7.6",
"vue-template-compiler" => "^2.6.12",
"vue" => "^2.5.17",
"datatables.net-dt" => "^1.10.21",
"jsrender" => "^1.0.5",
"sweetalert" => "^1.1.3",
"select2" => "^4.0.13",
"izitoast" => "^1.4.0",
'bootstrap' => '^4.0.0',
'jquery' => '^3.2',
'popper.js' => '^1.12',
'@fortawesome/fontawesome-free' => '^5.13.1',
'jquery.nicescroll' => '^3.7.6',
'vue-template-compiler' => '^2.6.12',
'vue' => '^2.5.17',
'datatables.net-dt' => '^1.10.21',
'jsrender' => '^1.0.5',
'sweetalert' => '^1.1.3',
'select2' => '^4.0.13',
'izitoast' => '^1.4.0',
],
'devDependencies' => [
"webpack" => "^5.23.0",
]
'webpack' => '^5.23.0',
],
];

return $stislaPackages[$configurationKey] + $packages;
Expand All @@ -75,7 +74,6 @@ protected static function updateWebpackConfiguration()
copy(__DIR__.'/../stisla-stubs/vendors/bootstrap/webpack.mix.js', base_path('webpack.mix.js'));
}


public function installAuth()
{
$viewsPath = LaravelUtils::getViewPath();
Expand All @@ -84,26 +82,26 @@ public function installAuth()

$this->scaffoldAuth();

if (! $this->isFortify) {
if (!$this->isFortify) {
$this->scaffoldController();
}
}

protected function ensureDirectoriesExist($viewsPath)
{
if (! file_exists($viewsPath.'layouts')) {
if (!file_exists($viewsPath.'layouts')) {
mkdir($viewsPath.'layouts', 0755, true);
}

if (! file_exists($viewsPath.'profile')) {
if (!file_exists($viewsPath.'profile')) {
mkdir($viewsPath.'profile', 0755, true);
}

if (! file_exists($viewsPath.'auth')) {
if (!file_exists($viewsPath.'auth')) {
mkdir($viewsPath.'auth', 0755, true);
}

if (! file_exists($viewsPath.'auth/passwords')) {
if (!file_exists($viewsPath.'auth/passwords')) {
mkdir($viewsPath.'auth/passwords', 0755, true);
}
}
Expand All @@ -128,7 +126,7 @@ private function addHomeRoute()

protected function scaffoldController()
{
if (! is_dir($directory = app_path('Http/Controllers/Auth'))) {
if (!is_dir($directory = app_path('Http/Controllers/Auth'))) {
mkdir($directory, 0755, true);
}

Expand All @@ -149,7 +147,7 @@ protected function scaffoldAuth()

$this->addHomeRoute();

if (! $this->isFortify) {
if (!$this->isFortify) {
$this->addAuthRoutes();
}

Expand All @@ -159,7 +157,6 @@ protected function scaffoldAuth()
$filesystem->copyDirectory(__DIR__.'/../stisla-stubs/views/profile', resource_path('views/profile'));
$filesystem->copy(__DIR__.'/../stisla-stubs/home.blade.php', resource_path('views/home.blade.php'));


collect($filesystem->allFiles(base_path('vendor/laravel/ui/stubs/migrations')))
->each(function (SplFileInfo $file) use ($filesystem) {
$filesystem->copy(
Expand Down

0 comments on commit 233a633

Please sign in to comment.