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

Commit 16171d5

Browse files
committed
Merge branch 'master' into 1.x
# Conflicts: # src/CoreUIPreset.php
2 parents 4399f9f + 5c10a33 commit 16171d5

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Laravel UI CoreUI
22

3+
[![Total Downloads](https://poser.pugx.org/infyomlabs/laravel-ui-coreui/downloads)](https://packagist.org/packages/infyomlabs/laravel-ui-coreui)
4+
[![Monthly Downloads](https://poser.pugx.org/infyomlabs/laravel-genui-coreuierator/d/monthly)](https://packagist.org/packages/infyomlabs/laravel-ui-coreui)
5+
[![Daily Downloads](https://poser.pugx.org/infyomlabs/laravel-ui-coreui/d/daily)](https://packagist.org/packages/infyomlabs/laravel-ui-coreui)
6+
[![License](https://poser.pugx.org/infyomlabs/laravel-ui-coreui/license)](https://packagist.org/packages/infyomlabs/laravel-ui-coreui)
7+
[![Build Status](https://travis-ci.org/InfyOmLabs/laravel-ui-coreui.svg?branch=test-cases)](https://travis-ci.org/InfyOmLabs/laravel-ui-coreui)
8+
39
[Laravel Frontend Scaffolding](https://laravel.com/docs/7.x/frontend) for [CoreUI](https://coreui.io/) Theme.
410

511
## Installation

src/CoreUIPreset.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public function installAuth()
7373
$this->ensureDirectoriesExist($viewsPath);
7474

7575
$this->scaffoldAuth();
76+
$this->scaffoldController();
7677
}
7778

7879
protected function ensureDirectoriesExist($viewsPath)
@@ -90,6 +91,23 @@ protected function ensureDirectoriesExist($viewsPath)
9091
}
9192
}
9293

94+
protected function scaffoldController()
95+
{
96+
if (!is_dir($directory = app_path('Http/Controllers/Auth'))) {
97+
mkdir($directory, 0755, true);
98+
}
99+
100+
$filesystem = new Filesystem;
101+
102+
collect($filesystem->allFiles(base_path('vendor/laravel/ui/stubs/Auth')))
103+
->each(function (SplFileInfo $file) use ($filesystem) {
104+
$filesystem->copy(
105+
$file->getPathname(),
106+
app_path('Http/Controllers/Auth/'.Str::replaceLast('.stub', '.php', $file->getFilename()))
107+
);
108+
});
109+
}
110+
93111
protected function scaffoldAuth()
94112
{
95113
file_put_contents(app_path('Http/Controllers/HomeController.php'), $this->compileHomeControllerStub());
@@ -105,6 +123,14 @@ protected function scaffoldAuth()
105123
$filesystem->copyDirectory(__DIR__.'/../coreui-stubs/auth', resource_path('views/auth'));
106124
$filesystem->copyDirectory(__DIR__.'/../coreui-stubs/layouts', resource_path('views/layouts'));
107125
$filesystem->copy(__DIR__.'/../coreui-stubs/home.blade.php', resource_path('views/home.blade.php'));
126+
127+
collect($filesystem->allFiles(base_path('vendor/laravel/ui/stubs/migrations')))
128+
->each(function (SplFileInfo $file) use ($filesystem) {
129+
$filesystem->copy(
130+
$file->getPathname(),
131+
database_path('migrations/'.$file->getFilename())
132+
);
133+
});
108134
});
109135
}
110136

src/CoreUIPresetServiceProvider.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ class CoreUIPresetServiceProvider extends ServiceProvider
1010
public function boot()
1111
{
1212
UiCommand::macro('coreui', function (UiCommand $command) {
13-
1413
$coreUIPreset = new CoreUIPreset($command);
1514
$coreUIPreset->install();
1615

0 commit comments

Comments
 (0)