├── src
├── stubs
│ ├── resources
│ │ ├── alpine
│ │ │ ├── js
│ │ │ │ ├── app.js
│ │ │ │ └── bootstrap.js
│ │ │ ├── css
│ │ │ │ └── app.css
│ │ │ ├── sidebar
│ │ │ │ ├── layouts
│ │ │ │ │ ├── auth.blade.php
│ │ │ │ │ └── app.blade.php
│ │ │ │ ├── auth
│ │ │ │ │ ├── login.blade.php
│ │ │ │ │ └── register.blade.php
│ │ │ │ ├── includes
│ │ │ │ │ └── sidebar.blade.php
│ │ │ │ ├── ui
│ │ │ │ │ └── index.blade.php
│ │ │ │ └── home.blade.php
│ │ │ └── stacked
│ │ │ │ ├── layouts
│ │ │ │ ├── auth.blade.php
│ │ │ │ └── app.blade.php
│ │ │ │ ├── auth
│ │ │ │ ├── login.blade.php
│ │ │ │ └── register.blade.php
│ │ │ │ ├── includes
│ │ │ │ └── nav.blade.php
│ │ │ │ ├── ui
│ │ │ │ └── index.blade.php
│ │ │ │ └── home.blade.php
│ │ └── vue
│ │ │ ├── js
│ │ │ ├── bootstrap.js
│ │ │ ├── components
│ │ │ │ └── UI
│ │ │ │ │ ├── BasePanel.vue
│ │ │ │ │ ├── BaseHeader.vue
│ │ │ │ │ ├── BaseInput.vue
│ │ │ │ │ ├── BaseNav.vue
│ │ │ │ │ └── BaseSidebar.vue
│ │ │ └── app.js
│ │ │ ├── css
│ │ │ └── app.css
│ │ │ ├── sidebar
│ │ │ ├── layouts
│ │ │ │ ├── auth.blade.php
│ │ │ │ └── app.blade.php
│ │ │ ├── auth
│ │ │ │ ├── login.blade.php
│ │ │ │ └── register.blade.php
│ │ │ ├── ui
│ │ │ │ └── index.blade.php
│ │ │ └── home.blade.php
│ │ │ └── stacked
│ │ │ ├── layouts
│ │ │ ├── auth.blade.php
│ │ │ └── app.blade.php
│ │ │ ├── auth
│ │ │ ├── login.blade.php
│ │ │ └── register.blade.php
│ │ │ ├── ui
│ │ │ └── index.blade.php
│ │ │ └── home.blade.php
│ ├── webpack.mix.js
│ ├── tailwind.config.js
│ └── controllers
│ │ └── HomeController.stub
├── TailwindCssDashboardPresetServiceProvider.php
└── Presets
│ ├── VuePreset.php
│ └── AlpinePreset.php
├── screenshots
├── login.png
├── register.png
├── preset_sidebar.png
└── preset_stacked.png
├── .gitignore
├── composer.json
└── README.md
/src/stubs/resources/alpine/js/app.js:
--------------------------------------------------------------------------------
1 | require('./bootstrap');
--------------------------------------------------------------------------------
/screenshots/login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Miaababikir/laravel-tailwind-css-dashboard-preset/HEAD/screenshots/login.png
--------------------------------------------------------------------------------
/screenshots/register.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Miaababikir/laravel-tailwind-css-dashboard-preset/HEAD/screenshots/register.png
--------------------------------------------------------------------------------
/screenshots/preset_sidebar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Miaababikir/laravel-tailwind-css-dashboard-preset/HEAD/screenshots/preset_sidebar.png
--------------------------------------------------------------------------------
/screenshots/preset_stacked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Miaababikir/laravel-tailwind-css-dashboard-preset/HEAD/screenshots/preset_stacked.png
--------------------------------------------------------------------------------
/src/stubs/resources/vue/js/bootstrap.js:
--------------------------------------------------------------------------------
1 | window.axios = require('axios');
2 |
3 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
4 |
5 |
--------------------------------------------------------------------------------
/src/stubs/resources/alpine/js/bootstrap.js:
--------------------------------------------------------------------------------
1 | window.axios = require('axios');
2 |
3 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
4 |
5 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules
2 | /public/hot
3 | /public/storage
4 | /storage/*.key
5 | /vendor
6 | composer.lock
7 | .idea
8 | .env
9 | .env.backup
10 | .phpunit.result.cache
11 | Homestead.json
12 | Homestead.yaml
13 | npm-debug.log
14 | yarn-error.log
15 |
--------------------------------------------------------------------------------
/src/stubs/webpack.mix.js:
--------------------------------------------------------------------------------
1 | const mix = require('laravel-mix');
2 |
3 | mix.js('resources/js/app.js', 'public/js')
4 | .vue()
5 | .postCss('resources/css/app.css', 'public/css', [
6 | require('tailwindcss'),
7 | require('autoprefixer'),
8 | ]);
9 |
--------------------------------------------------------------------------------
/src/stubs/resources/vue/js/components/UI/BasePanel.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
16 |
--------------------------------------------------------------------------------
/src/stubs/resources/alpine/css/app.css:
--------------------------------------------------------------------------------
1 | /* You can use this font for arabic sites */
2 | /*@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700&display=swap');*/
3 |
4 | @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700&display=swap');
5 |
6 | @tailwind base;
7 |
8 | @tailwind components;
9 |
10 | @tailwind utilities;
11 |
--------------------------------------------------------------------------------
/src/stubs/resources/vue/css/app.css:
--------------------------------------------------------------------------------
1 | /* You can use this font for arabic sites */
2 | /*@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700&display=swap');*/
3 |
4 | @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700&display=swap');
5 |
6 | @tailwind base;
7 |
8 | @tailwind components;
9 |
10 | @tailwind utilities;
11 |
--------------------------------------------------------------------------------
/src/stubs/tailwind.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | purge: [],
3 | theme: {
4 | fontFamily: {
5 | 'base': 'Inter',
6 | // 'base-ar': 'Tajawal' // I love this font for arabic
7 | },
8 | extend: {},
9 | },
10 | variants: {},
11 | plugins: [
12 | require('@tailwindcss/forms')({
13 | strategy: 'class',
14 | }),
15 | ],
16 | };
17 |
--------------------------------------------------------------------------------
/src/stubs/resources/vue/js/components/UI/BaseHeader.vue:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
15 |
16 |
19 |
--------------------------------------------------------------------------------
/src/stubs/resources/vue/js/app.js:
--------------------------------------------------------------------------------
1 | require('./bootstrap');
2 |
3 | import Vue from 'vue';
4 |
5 | Vue.component('base-nav', require('./components/UI/BaseNav').default);
6 | Vue.component('base-header', require('./components/UI/BaseHeader').default);
7 | Vue.component('base-panel', require('./components/UI/BasePanel').default);
8 | Vue.component('base-input', require('./components/UI/BaseInput').default);
9 | Vue.component('base-sidebar', require('./components/UI/BaseSidebar').default);
10 |
11 | const app = new Vue({
12 | el: '#app',
13 | });
14 |
--------------------------------------------------------------------------------
/src/stubs/controllers/HomeController.stub:
--------------------------------------------------------------------------------
1 | middleware('auth');
17 | }
18 |
19 | /**
20 | * Show the application dashboard.
21 | *
22 | * @return \Illuminate\Http\Response
23 | */
24 | public function index()
25 | {
26 | return view('home');
27 | }
28 | }
--------------------------------------------------------------------------------
/src/stubs/resources/vue/sidebar/layouts/auth.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | Laravel
11 |
12 |
13 |
14 |
15 |
16 |
17 | @yield('content')
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/stubs/resources/vue/stacked/layouts/auth.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | Laravel
11 |
12 |
13 |
14 |
15 |
16 |
17 | @yield('content')
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/stubs/resources/alpine/sidebar/layouts/auth.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | Laravel
11 |
12 |
13 |
14 |
15 |
16 |
17 | @yield('content')
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/stubs/resources/alpine/stacked/layouts/auth.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | Laravel
11 |
12 |
13 |
14 |
15 |
16 |
17 | @yield('content')
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "miaababikir/laravel-tailwind-dashboard-preset",
3 | "description": "Laravel tailwind css dashboard preset",
4 | "keywords": [
5 | "laravel",
6 | "preset",
7 | "tailwindcss"
8 | ],
9 | "license": "MIT",
10 | "authors": [
11 | {
12 | "name": "Mosab Ibrahim",
13 | "email": "miaababikir@gmail.com"
14 | }
15 | ],
16 | "require": {
17 | "laravel/framework": "^7.0|^8.0",
18 | "laravel/ui": "^2.0|^3.0"
19 | },
20 | "autoload": {
21 | "psr-4": {
22 | "Miaababikir\\TailwindCssDashboardPreset\\": "src/"
23 | }
24 | },
25 | "extra": {
26 | "laravel": {
27 | "providers": [
28 | "Miaababikir\\TailwindCssDashboardPreset\\TailwindCssDashboardPresetServiceProvider"
29 | ]
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/stubs/resources/vue/js/components/UI/BaseInput.vue:
--------------------------------------------------------------------------------
1 |
2 |
15 |
16 |
17 |
32 |
33 |
36 |
--------------------------------------------------------------------------------
/src/stubs/resources/vue/stacked/layouts/app.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | Laravel
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | @yield('header')
22 |
23 |
24 |
25 |
26 |
27 |
28 | @yield('content')
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/src/stubs/resources/alpine/stacked/layouts/app.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | Laravel
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | @include('includes.nav')
24 |
25 | @yield('header')
26 |
27 |
28 |
29 |
30 |
31 |
32 | @yield('content')
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/src/TailwindCssDashboardPresetServiceProvider.php:
--------------------------------------------------------------------------------
1 | option('option')[0]);
23 |
24 | if (in_array($options[1], $this->layouts)) {
25 | if ($options[0] == 'vue') {
26 | VuePreset::install($options[1]);
27 |
28 | $command->info('Vue Tailwind CSS auth scaffolding installed successfully.');
29 | }
30 |
31 | if ($options[0] == 'alpine') {
32 | AlpinePreset::install($options[1]);
33 |
34 | $command->info('Alpine Tailwind CSS auth scaffolding installed successfully.');
35 | }
36 |
37 | $command->comment('Please run "npm install && npm run dev" to compile your fresh scaffolding.');
38 | } else {
39 | $command->error('Please choose one of the available layouts [stacked, sidebar]');
40 | }
41 | });
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # :fire: Laravel tailwind css dashboard preset
2 | [](//packagist.org/packages/miaababikir/laravel-tailwind-dashboard-preset) [](//packagist.org/packages/miaababikir/laravel-tailwind-dashboard-preset) [](//packagist.org/packages/miaababikir/laravel-tailwind-dashboard-preset)
3 |
4 | A Laravel dashboard front-end scaffolding preset for [Tailwind CSS](https://tailwindcss.com) - Support RTL out of the box.
5 |
6 | ## Usage
7 |
8 | 1. Fresh install Laravel >= 7.0|8.0 and `cd` to your app.
9 | 2. Install this preset via `composer require miaababikir/laravel-tailwind-dashboard-preset`. Laravel will automatically discover this package. No need to register the service provider.
10 |
11 | ### For Vue preset with stacked layout
12 |
13 | 1. Use `php artisan ui tailwind-dashboard --option=vue.stacked`
14 | 2. `npm install && npm run dev`
15 | 3. `php artisan serve` (or equivalent) to run server and test preset.
16 |
17 | ### For Vue preset with sidebar layout
18 |
19 | 1. Use `php artisan ui tailwind-dashboard --option=vue.sidebar`
20 | 2. `npm install && npm run dev`
21 | 3. `php artisan serve` (or equivalent) to run server and test preset.
22 |
23 | ### For Alpine preset with stacked layout
24 |
25 | 1. Use `php artisan ui tailwind-dashboard --option=alpine.stacked`
26 | 2. `npm install && npm run dev`
27 | 3. `php artisan serve` (or equivalent) to run server and test preset.
28 |
29 | ### For Alpine preset with sidebar layout
30 |
31 | 1. Use `php artisan ui tailwind-dashboard --option=alpine.sidebar`
32 | 2. `npm install && npm run dev`
33 | 3. `php artisan serve` (or equivalent) to run server and test preset.
34 |
35 | ### Todo
36 | - [ ] Password reset
37 | - [ ] Verify email
38 | - [ ] Welcome
39 |
40 | ### Screenshots
41 |
42 | 
43 |
44 | 
45 |
46 | 
47 |
48 | 
49 |
--------------------------------------------------------------------------------
/src/stubs/resources/vue/sidebar/layouts/app.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | Laravel
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
39 |
40 |
41 |
42 | @yield('content')
43 |
44 |
45 |
46 |
47 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/src/stubs/resources/alpine/sidebar/layouts/app.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | Laravel
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | @include('includes.sidebar')
24 |
25 |
26 |
42 |
43 |
44 |
45 | @yield('content')
46 |
47 |
48 |
49 |
50 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/src/stubs/resources/alpine/sidebar/auth/login.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.auth')
2 |
3 | @section('content')
4 |
5 |
6 |
7 |
Brand
8 |
Welcome Back
9 |
Login or Register
10 |
38 |
39 |
40 |
Don't have an account
41 |
Register now
42 |
43 |
44 |
45 | @endsection
46 |
--------------------------------------------------------------------------------
/src/stubs/resources/alpine/stacked/auth/login.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.auth')
2 |
3 | @section('content')
4 |
5 |
6 |
7 |
Brand
8 |
Welcome Back
9 |
Login or Register
10 |
38 |
39 |
40 |
Don't have an account
41 |
Register now
42 |
43 |
44 |
45 | @endsection
46 |
--------------------------------------------------------------------------------
/src/stubs/resources/vue/sidebar/auth/login.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.auth')
2 |
3 | @section('content')
4 |
5 |
6 |
7 |
Brand
8 |
Welcome Back
9 |
Login or Register
10 |
38 |
39 |
40 |
Don't have an account
41 |
Register now
42 |
43 |
44 |
45 | @endsection
46 |
--------------------------------------------------------------------------------
/src/stubs/resources/vue/stacked/auth/login.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.auth')
2 |
3 | @section('content')
4 |
5 |
6 |
7 |
Brand
8 |
Welcome Back
9 |
Login or Register
10 |
38 |
39 |
40 |
Don't have an account
41 |
Register now
42 |
43 |
44 |
45 | @endsection
46 |
--------------------------------------------------------------------------------
/src/stubs/resources/alpine/sidebar/auth/register.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.auth')
2 |
3 | @section('content')
4 |
5 |
6 |
7 |
Brand
8 |
Welcome back
9 |
Create new account
10 |
51 |
52 |
53 |
Already have account?
54 |
Login
55 |
56 |
57 |
58 | @endsection
59 |
--------------------------------------------------------------------------------
/src/stubs/resources/alpine/stacked/auth/register.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.auth')
2 |
3 | @section('content')
4 |
5 |
6 |
7 |
Brand
8 |
Welcome back
9 |
Create new account
10 |
51 |
52 |
53 |
Already have account?
54 |
Login
55 |
56 |
57 |
58 | @endsection
59 |
--------------------------------------------------------------------------------
/src/stubs/resources/vue/sidebar/auth/register.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.auth')
2 |
3 | @section('content')
4 |
5 |
6 |
7 |
Brand
8 |
Welcome back
9 |
Create new account
10 |
51 |
52 |
53 |
Already have account?
54 |
Login
55 |
56 |
57 |
58 | @endsection
59 |
--------------------------------------------------------------------------------
/src/stubs/resources/vue/stacked/auth/register.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.auth')
2 |
3 | @section('content')
4 |
5 |
6 |
7 |
Brand
8 |
Welcome back
9 |
Create new account
10 |
51 |
52 |
53 |
Already have account?
54 |
Login
55 |
56 |
57 |
58 | @endsection
59 |
--------------------------------------------------------------------------------
/src/Presets/VuePreset.php:
--------------------------------------------------------------------------------
1 | "^0.21",
37 | 'resolve-url-loader' => '^2.3.1',
38 | 'vue' => '^2.6.12',
39 | "laravel-mix" =>"^6.0.6",
40 | 'vue-template-compiler' => '^2.6.12',
41 | "@tailwindcss/forms"=> "^0.4.0",
42 | "tailwindcss" => "^2.2.19"
43 |
44 | ], Arr::except($packages, [
45 | 'bootstrap',
46 | 'bootstrap-sass',
47 | 'popper.js',
48 | 'jquery',
49 | ]));
50 | }
51 |
52 | protected static function scaffoldController()
53 | {
54 | if (!is_dir($directory = app_path('Http/Controllers/Auth'))) {
55 | mkdir($directory, 0755, true);
56 | }
57 |
58 | $filesystem = new Filesystem;
59 |
60 | collect($filesystem->allFiles(base_path('vendor/laravel/ui/stubs/Auth')))
61 | ->each(function (SplFileInfo $file) use ($filesystem) {
62 | $filesystem->copy(
63 | $file->getPathname(),
64 | app_path('Http/Controllers/Auth/' . Str::replaceLast('.stub', '.php', $file->getFilename()))
65 | );
66 | });
67 | }
68 |
69 | protected static function scaffoldAuth()
70 | {
71 | file_put_contents(app_path('Http/Controllers/HomeController.php'), static::compileControllerStub());
72 |
73 | file_put_contents(
74 | base_path('routes/web.php'),
75 | "Auth::routes();\n\nRoute::get('/home', [\App\Http\Controllers\HomeController::class, 'index'])->name('home');\n\nRoute::view('/ui', 'ui.index');\n\n",
76 | FILE_APPEND
77 | );
78 | }
79 |
80 | protected static function scaffoldViews()
81 | {
82 | tap(new Filesystem, function ($filesystem) {
83 | $filesystem->copyDirectory(__DIR__ . '/../stubs/resources/vue/' . static::$type, resource_path('views'));
84 |
85 | collect($filesystem->allFiles(base_path('vendor/laravel/ui/stubs/migrations')))
86 | ->each(function (SplFileInfo $file) use ($filesystem) {
87 | $filesystem->copy(
88 | $file->getPathname(),
89 | database_path('migrations/' . $file->getFilename())
90 | );
91 | });
92 | });
93 | }
94 |
95 | protected static function updateStyles()
96 | {
97 | tap(new Filesystem, function ($filesystem) {
98 | $filesystem->deleteDirectory(resource_path('sass'));
99 | $filesystem->delete(public_path('css/app.css'));
100 |
101 | if (!$filesystem->isDirectory($directory = resource_path('css'))) {
102 | $filesystem->makeDirectory($directory, 0755, true);
103 | }
104 | });
105 |
106 | copy(__DIR__ . '/../stubs/resources/vue/css/app.css', resource_path('css/app.css'));
107 | }
108 |
109 | protected static function updateJavascript()
110 | {
111 | tap(new Filesystem, function ($filesystem) {
112 | $filesystem->deleteDirectory(resource_path('js'));
113 | $filesystem->delete(public_path('js/app.js'));
114 |
115 | if (!$filesystem->isDirectory($directory = resource_path('js'))) {
116 | $filesystem->copyDirectory(__DIR__ . '/../stubs/resources/vue/js', resource_path('js'));
117 | }
118 | });
119 | }
120 |
121 | protected static function updateBootstrapping()
122 | {
123 | copy(__DIR__ . '/../stubs/tailwind.config.js', base_path('tailwind.config.js'));
124 |
125 | copy(__DIR__ . '/../stubs/webpack.mix.js', base_path('webpack.mix.js'));
126 | }
127 |
128 | protected static function compileControllerStub()
129 | {
130 | return file_get_contents(__DIR__.'/../stubs/controllers/HomeController.stub');
131 | }
132 | }
133 |
--------------------------------------------------------------------------------
/src/Presets/AlpinePreset.php:
--------------------------------------------------------------------------------
1 | "^0.19",
37 | "cross-env" => "^7.0",
38 | "laravel-mix" =>"^6.0.6",
39 | "resolve-url-loader" => "^2.3.1",
40 | "@tailwindcss/forms"=> "^0.4.0",
41 | "tailwindcss" => "^2.2.19"
42 |
43 | ], Arr::except($packages, [
44 | 'bootstrap',
45 | 'bootstrap-sass',
46 | 'popper.js',
47 | 'laravel-mix',
48 | 'jquery',
49 | 'sass',
50 | 'sass-loader'
51 | ]));
52 | }
53 |
54 | protected static function scaffoldController()
55 | {
56 | if (!is_dir($directory = app_path('Http/Controllers/Auth'))) {
57 | mkdir($directory, 0755, true);
58 | }
59 |
60 | $filesystem = new Filesystem;
61 |
62 | collect($filesystem->allFiles(base_path('vendor/laravel/ui/stubs/Auth')))
63 | ->each(function (SplFileInfo $file) use ($filesystem) {
64 | $filesystem->copy(
65 | $file->getPathname(),
66 | app_path('Http/Controllers/Auth/' . Str::replaceLast('.stub', '.php', $file->getFilename()))
67 | );
68 | });
69 | }
70 |
71 | protected static function scaffoldAuth()
72 | {
73 | file_put_contents(app_path('Http/Controllers/HomeController.php'), static::compileControllerStub());
74 |
75 | file_put_contents(
76 | base_path('routes/web.php'),
77 | "Auth::routes();\n\nRoute::get('/home', [\App\Http\Controllers\HomeController::class, 'index'])->name('home');\n\nRoute::view('/ui', 'ui.index');\n\n",
78 | FILE_APPEND
79 | );
80 | }
81 |
82 | protected static function scaffoldViews()
83 | {
84 | tap(new Filesystem, function ($filesystem) {
85 | $filesystem->copyDirectory(__DIR__ . '/../stubs/resources/alpine/' . static::$type, resource_path('views'));
86 |
87 | collect($filesystem->allFiles(base_path('vendor/laravel/ui/stubs/migrations')))
88 | ->each(function (SplFileInfo $file) use ($filesystem) {
89 | $filesystem->copy(
90 | $file->getPathname(),
91 | database_path('migrations/' . $file->getFilename())
92 | );
93 | });
94 | });
95 | }
96 |
97 | protected static function updateStyles()
98 | {
99 | tap(new Filesystem, function ($filesystem) {
100 | $filesystem->deleteDirectory(resource_path('sass'));
101 | $filesystem->delete(public_path('css/app.css'));
102 |
103 | if (!$filesystem->isDirectory($directory = resource_path('css'))) {
104 | $filesystem->makeDirectory($directory, 0755, true);
105 | }
106 | });
107 |
108 | copy(__DIR__ . '/../stubs/resources/alpine/css/app.css', resource_path('css/app.css'));
109 | }
110 |
111 | protected static function updateJavascript()
112 | {
113 | tap(new Filesystem, function ($filesystem) {
114 | $filesystem->deleteDirectory(resource_path('js'));
115 | $filesystem->delete(public_path('js/app.js'));
116 |
117 | if (!$filesystem->isDirectory($directory = resource_path('js'))) {
118 | $filesystem->copyDirectory(__DIR__ . '/../stubs/resources/alpine/js', resource_path('js'));
119 | }
120 | });
121 | }
122 |
123 | protected static function updateBootstrapping()
124 | {
125 | copy(__DIR__ . '/../stubs/tailwind.config.js', base_path('tailwind.config.js'));
126 |
127 | copy(__DIR__ . '/../stubs/webpack.mix.js', base_path('webpack.mix.js'));
128 | }
129 |
130 | protected static function compileControllerStub()
131 | {
132 | return file_get_contents(__DIR__.'/../stubs/controllers/HomeController.stub');
133 | }
134 | }
135 |
--------------------------------------------------------------------------------
/src/stubs/resources/alpine/stacked/includes/nav.blade.php:
--------------------------------------------------------------------------------
1 |
89 |
--------------------------------------------------------------------------------
/src/stubs/resources/vue/js/components/UI/BaseNav.vue:
--------------------------------------------------------------------------------
1 |
2 |
77 |
78 |
79 |
95 |
96 |
99 |
--------------------------------------------------------------------------------
/src/stubs/resources/alpine/sidebar/includes/sidebar.blade.php:
--------------------------------------------------------------------------------
1 |
101 |
--------------------------------------------------------------------------------
/src/stubs/resources/vue/js/components/UI/BaseSidebar.vue:
--------------------------------------------------------------------------------
1 |
2 |
102 |
103 |
104 |
120 |
121 |
124 |
--------------------------------------------------------------------------------
/src/stubs/resources/vue/sidebar/ui/index.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.app')
2 |
3 | @section('content')
4 |
5 |
6 | Tables
7 |
8 |
9 |
10 |
12 |
13 |
14 |
15 | |
16 | Name
17 | |
18 |
19 | Title
20 | |
21 |
22 | Status
23 | |
24 |
25 | Role
26 | |
27 | |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | 
38 |
39 |
40 | Jone Doe
41 | bernardlane@example.com
42 |
43 |
44 | |
45 |
46 | Software Engineer
47 | |
48 |
49 |
51 | Active
52 |
53 | |
54 |
55 | Owner
56 | |
57 |
58 | Edit
59 | |
60 |
61 |
62 |
63 |
64 |
65 | 
68 |
69 |
70 | Jone Doe
71 | bernardlane@example.com
72 |
73 |
74 | |
75 |
76 | Actor
77 | |
78 |
79 |
81 | Active
82 |
83 | |
84 |
85 | Owner
86 | |
87 |
88 | Edit
89 | |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 | Steve forms
102 |
103 |
104 |
105 |
106 |
Account details
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
Account details
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 | Casual forms
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 | Buttons
140 |
141 |
144 |
147 |
149 |
150 |
151 |
152 |
153 |
154 |
156 |
157 |
158 |
159 |
160 |
161 | @endsection
162 |
--------------------------------------------------------------------------------
/src/stubs/resources/vue/stacked/ui/index.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.app')
2 |
3 | @section('header')
4 |
5 | @endsection
6 |
7 | @section('content')
8 |
9 |
10 | Tables
11 |
12 |
13 |
14 |
16 |
17 |
18 |
19 | |
20 | Name
21 | |
22 |
23 | Title
24 | |
25 |
26 | Status
27 | |
28 |
29 | Role
30 | |
31 | |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 | 
42 |
43 |
44 | Jone Doe
45 | bernardlane@example.com
46 |
47 |
48 | |
49 |
50 | Software Engineer
51 | |
52 |
53 |
55 | Active
56 |
57 | |
58 |
59 | Owner
60 | |
61 |
62 | Edit
63 | |
64 |
65 |
66 |
67 |
68 |
69 | 
72 |
73 |
74 | Jone Doe
75 | bernardlane@example.com
76 |
77 |
78 | |
79 |
80 | Actor
81 | |
82 |
83 |
85 | Active
86 |
87 | |
88 |
89 | Owner
90 | |
91 |
92 | Edit
93 | |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 | Steve forms
106 |
107 |
108 |
109 |
110 |
Account details
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
Account details
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 | Casual forms
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 | Buttons
144 |
145 |
148 |
151 |
153 |
154 |
155 |
156 |
157 |
158 |
160 |
161 |
162 |
163 |
164 |
165 | @endsection
166 |
--------------------------------------------------------------------------------
/src/stubs/resources/alpine/sidebar/ui/index.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.app')
2 |
3 | @section('content')
4 |
5 |
6 |
Tables
7 |
8 |
9 |
10 |
12 |
13 |
14 |
15 | |
17 | Name
18 | |
19 |
21 | Title
22 | |
23 |
25 | Status
26 | |
27 |
29 | Role
30 | |
31 | |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 | 
42 |
43 |
44 | Jone Doe
45 | bernardlane@example.com
46 |
47 |
48 | |
49 |
50 | Software Engineer
51 | |
52 |
53 |
55 | Active
56 |
57 | |
58 |
59 | Owner
60 | |
61 |
62 | Edit
63 | |
64 |
65 |
66 |
67 |
68 |
69 | 
72 |
73 |
74 | Jone Doe
75 | bernardlane@example.com
76 |
77 |
78 | |
79 |
80 | Actor
81 | |
82 |
83 |
85 | Active
86 |
87 | |
88 |
89 | Owner
90 | |
91 |
92 | Edit
93 | |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
Steve forms
105 |
147 |
148 |
149 |
150 |
Casual forms
151 |
179 |
180 |
181 |
182 |
Buttons
183 |
184 |
187 |
190 |
192 |
193 |
194 |
195 |
196 |
197 |
199 |
200 |
201 |
202 |
203 |
204 | @endsection
205 |
--------------------------------------------------------------------------------
/src/stubs/resources/alpine/stacked/ui/index.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.app')
2 |
3 | @section('header')
4 |
9 | @endsection
10 |
11 | @section('content')
12 |
13 |
14 |
Tables
15 |
16 |
17 |
18 |
20 |
21 |
22 |
23 | |
25 | Name
26 | |
27 |
29 | Title
30 | |
31 |
33 | Status
34 | |
35 |
37 | Role
38 | |
39 | |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | 
50 |
51 |
52 | Jone Doe
53 | bernardlane@example.com
54 |
55 |
56 | |
57 |
58 | Software Engineer
59 | |
60 |
61 |
63 | Active
64 |
65 | |
66 |
67 | Owner
68 | |
69 |
70 | Edit
71 | |
72 |
73 |
74 |
75 |
76 |
77 | 
80 |
81 |
82 | Jone Doe
83 | bernardlane@example.com
84 |
85 |
86 | |
87 |
88 | Actor
89 | |
90 |
91 |
93 | Active
94 |
95 | |
96 |
97 | Owner
98 | |
99 |
100 | Edit
101 | |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
Steve forms
113 |
155 |
156 |
157 |
158 |
Casual forms
159 |
187 |
188 |
189 |
190 |
Buttons
191 |
192 |
195 |
198 |
200 |
201 |
202 |
203 |
204 |
205 |
207 |
208 |
209 |
210 |
211 |
212 | @endsection
213 |
--------------------------------------------------------------------------------
/src/stubs/resources/vue/sidebar/home.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.app')
2 |
3 | @section('content')
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | New users
16 |
17 |
18 | 2,356
19 |
20 |
21 |
31 |
32 |
33 |
34 | 3.48%
35 |
36 |
37 | Since last week
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 | Sales
50 |
51 |
52 | 924
53 |
54 |
55 |
65 |
66 |
67 |
68 | 1.10%
69 |
70 |
71 | Since yesterday
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 | Performance
84 |
85 |
86 | 49,65%
87 |
88 |
89 |
99 |
100 |
101 |
102 | 12%
103 |
104 |
105 | Since last month
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
Tables
117 |
118 |
119 |
120 |
122 |
123 |
124 |
125 | |
127 | Name
128 | |
129 |
131 | Title
132 | |
133 |
135 | Status
136 | |
137 |
139 | Role
140 | |
141 | |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 | 
152 |
153 |
154 | Jone Doe
155 | bernardlane@example.com
156 |
157 |
158 | |
159 |
160 | Software Engineer
161 | |
162 |
163 |
165 | Active
166 |
167 | |
168 |
169 | Owner
170 | |
171 |
172 | Edit
173 | |
174 |
175 |
176 |
177 |
178 |
179 | 
182 |
183 |
184 | Jone Doe
185 | bernardlane@example.com
186 |
187 |
188 | |
189 |
190 | Actor
191 | |
192 |
193 |
195 | Active
196 |
197 | |
198 |
199 | Owner
200 | |
201 |
202 | Edit
203 | |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 | @endsection
216 |
--------------------------------------------------------------------------------
/src/stubs/resources/alpine/sidebar/home.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.app')
2 |
3 | @section('content')
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | New users
16 |
17 |
18 | 2,356
19 |
20 |
21 |
31 |
32 |
33 |
34 | 3.48%
35 |
36 |
37 | Since last week
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 | Sales
50 |
51 |
52 | 924
53 |
54 |
55 |
65 |
66 |
67 |
68 | 1.10%
69 |
70 |
71 | Since yesterday
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 | Performance
84 |
85 |
86 | 49,65%
87 |
88 |
89 |
99 |
100 |
101 |
102 | 12%
103 |
104 |
105 | Since last month
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
Tables
117 |
118 |
119 |
120 |
122 |
123 |
124 |
125 | |
127 | Name
128 | |
129 |
131 | Title
132 | |
133 |
135 | Status
136 | |
137 |
139 | Role
140 | |
141 | |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 | 
152 |
153 |
154 | Jone Doe
155 | bernardlane@example.com
156 |
157 |
158 | |
159 |
160 | Software Engineer
161 | |
162 |
163 |
165 | Active
166 |
167 | |
168 |
169 | Owner
170 | |
171 |
172 | Edit
173 | |
174 |
175 |
176 |
177 |
178 |
179 | 
182 |
183 |
184 | Jone Doe
185 | bernardlane@example.com
186 |
187 |
188 | |
189 |
190 | Actor
191 | |
192 |
193 |
195 | Active
196 |
197 | |
198 |
199 | Owner
200 | |
201 |
202 | Edit
203 | |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 | @endsection
216 |
--------------------------------------------------------------------------------
/src/stubs/resources/vue/stacked/home.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.app')
2 |
3 | @section('header')
4 |
5 | @endsection
6 |
7 | @section('content')
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | New users
20 |
21 |
22 | 2,356
23 |
24 |
25 |
35 |
36 |
37 |
38 | 3.48%
39 |
40 |
41 | Since last week
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 | Sales
54 |
55 |
56 | 924
57 |
58 |
59 |
69 |
70 |
71 |
72 | 1.10%
73 |
74 |
75 | Since yesterday
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 | Performance
88 |
89 |
90 | 49,65%
91 |
92 |
93 |
103 |
104 |
105 |
106 | 12%
107 |
108 |
109 | Since last month
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
Tables
121 |
122 |
123 |
124 |
126 |
127 |
128 |
129 | |
131 | Name
132 | |
133 |
135 | Title
136 | |
137 |
139 | Status
140 | |
141 |
143 | Role
144 | |
145 | |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 | 
156 |
157 |
158 | Jone Doe
159 | bernardlane@example.com
160 |
161 |
162 | |
163 |
164 | Software Engineer
165 | |
166 |
167 |
169 | Active
170 |
171 | |
172 |
173 | Owner
174 | |
175 |
176 | Edit
177 | |
178 |
179 |
180 |
181 |
182 |
183 | 
186 |
187 |
188 | Jone Doe
189 | bernardlane@example.com
190 |
191 |
192 | |
193 |
194 | Actor
195 | |
196 |
197 |
199 | Active
200 |
201 | |
202 |
203 | Owner
204 | |
205 |
206 | Edit
207 | |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 | @endsection
218 |
--------------------------------------------------------------------------------
/src/stubs/resources/alpine/stacked/home.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.app')
2 |
3 | @section('header')
4 |
9 | @endsection
10 |
11 | @section('content')
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | New users
24 |
25 |
26 | 2,356
27 |
28 |
29 |
39 |
40 |
41 |
42 | 3.48%
43 |
44 |
45 | Since last week
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 | Sales
58 |
59 |
60 | 924
61 |
62 |
63 |
73 |
74 |
75 |
76 | 1.10%
77 |
78 |
79 | Since yesterday
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 | Performance
92 |
93 |
94 | 49,65%
95 |
96 |
97 |
107 |
108 |
109 |
110 | 12%
111 |
112 |
113 | Since last month
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
Tables
125 |
126 |
127 |
128 |
130 |
131 |
132 |
133 | |
135 | Name
136 | |
137 |
139 | Title
140 | |
141 |
143 | Status
144 | |
145 |
147 | Role
148 | |
149 | |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 | 
160 |
161 |
162 | Jone Doe
163 | bernardlane@example.com
164 |
165 |
166 | |
167 |
168 | Software Engineer
169 | |
170 |
171 |
173 | Active
174 |
175 | |
176 |
177 | Owner
178 | |
179 |
180 | Edit
181 | |
182 |
183 |
184 |
185 |
186 |
187 | 
190 |
191 |
192 | Jone Doe
193 | bernardlane@example.com
194 |
195 |
196 | |
197 |
198 | Actor
199 | |
200 |
201 |
203 | Active
204 |
205 | |
206 |
207 | Owner
208 | |
209 |
210 | Edit
211 | |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 | @endsection
222 |
--------------------------------------------------------------------------------