├── .gitignore ├── LICENSE.md ├── README.md ├── composer.json ├── composer.lock ├── config └── laravel-vien.php ├── docs ├── select-simple.md └── select-simple.png ├── pint.json ├── public ├── sc1.png ├── sc2.png ├── sc3.png ├── sc4.png ├── sc5.png └── sc6.png ├── src ├── Concern │ ├── FileGenerator.php │ └── ReplaceResourceKeywords.php ├── Console │ ├── Concern │ │ └── CommonConsoleTrait.php │ ├── GeneratorCommand.php │ ├── InstallCommand.php │ └── UpdateCommand.php ├── Generator │ ├── CommonGeneratorTrait.php │ ├── ControllerGenerator.php │ ├── CreateGenerator.php │ ├── EditGenerator.php │ ├── IndexGenerator.php │ ├── RouteGenerator.php │ ├── ShowGenerator.php │ └── Stubs │ │ ├── controller.stub │ │ ├── create.stub │ │ ├── edit.stub │ │ ├── index.stub │ │ └── show.stub └── VienServiceProvider.php └── stubs └── inertia-vue ├── Controllers ├── SettingController.php └── UserController.php ├── Default ├── AuthenticatedLayout.vue ├── app.css ├── app.js └── tailwind.config.js ├── Middleware └── HandleInertiaRequests.php ├── Models └── Setting.php ├── Pages ├── Setting │ ├── Create.vue │ ├── Edit.vue │ ├── Index.vue │ └── Show.vue └── User │ ├── Create.vue │ ├── Edit.vue │ ├── Index.vue │ └── Show.vue ├── Vien ├── AppToast.vue ├── Button.vue ├── Checkbox.vue ├── Container.vue ├── DeleteModal.vue ├── InputDateTime.vue ├── InputText.vue ├── Loading.vue ├── Pagination.vue ├── SelectSimple.vue ├── SideBar.vue ├── SideBarMenuItem.vue ├── SideBarSubMenuItem.vue ├── Table.vue ├── TextArea.vue ├── Toast.vue ├── Toggle.vue ├── ToggleDarkMode.vue └── Utils │ ├── debounce.js │ ├── menu-items.js │ ├── table-action.js │ ├── table-filter.js │ ├── table-logic.js │ ├── table-row.js │ ├── table-sort.js │ └── table-toggle-column.js ├── database ├── factories │ └── SettingFactory.php ├── migrations │ └── 0001_01_01_000003_create_settings_tables.php └── seeders │ └── DatabaseSeeder.php └── routes └── web.php /.gitignore: -------------------------------------------------------------------------------- 1 | vendor/ 2 | node_modules/ 3 | .DS_Store 4 | .vscode/ 5 | .idea/ -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Labkita 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

Laravel Vien

2 |

3 | 4 | Total Downloads 5 | 6 | 7 | Latest Stable Version 8 | 9 | 10 | License 11 | 12 |

13 | 14 | This package is a starter kit for laravel breeze with inertia vue stack, so it requires laravel [breeze and inertia vue stack](https://laravel.com/docs/11.x/starter-kits#breeze-and-inertia) 15 | 16 | Laravel vien provides laravel inertia vue components, when you install this package, it will generate all the components in `resources/js/Components/Vien` directory. 17 | 18 | No magic behind the scene, you can customize as much as you want 19 | 20 | ## Features 21 | 22 | - Table component with search, sort, filter, pagination, toggle, select and bulk action 23 | - Resource Generator to quickly generate CRUD 24 | - Toggle dark mode and light mode component 25 | - Responsive sidebar component 26 | - Flash message using toast component 27 | - Loading spinner component 28 | - [SelectSimple](./docs/select-simple.md) component 29 | - InputDateTime component using flatpickr 30 | - TextArea compoonent 31 | - Toggle switch component 32 | 33 | for available components you can check in `stubs/inertia-vue/Vien` directory or `resources/js/Components/Vien` after vien installed. 34 | 35 | here is some screenshot: 36 | 37 |

38 | 39 | 40 |

41 |

42 | 43 | 44 |

45 |

46 | 47 | 48 |

49 | 50 | ## Requirement 51 | 52 | - PHP >= 8.2 53 | - Laravel >= 10 54 | - Laravel [Breeze Stack Inertia Vue](https://laravel.com/docs/11.x/starter-kits#breeze-and-inertia) 55 | 56 | ## Getting Started 57 | 58 | ### Package installation 59 | 60 | ```bash 61 | composer require --dev jhonoryza/laravel-vien 62 | ``` 63 | 64 | ### Vien installation 65 | 66 | ```bash 67 | php artisan vien:install 68 | ``` 69 | 70 | this will copy all vien component scaffolding 71 | 72 | after installed successfully you can remove this package from your dev requirement 73 | 74 | ### Optional to update vien components 75 | 76 | ```bash 77 | php artisan vien:update 78 | ``` 79 | 80 | ### Optional to use resource generator 81 | 82 | before using this generator, make sure you have already your new migration and models, example: lets make a `posts` table, then run `artisan migrate` 83 | 84 | then you can run the following command to generate the resource 85 | 86 | ```bash 87 | php artisan vien:generate posts 88 | ``` 89 | 90 | After successfully generating the resource above, then adjust 91 | 92 | `resources/js/Components/Vien/Utils/menu-items.js` file to add your `new navigation menu`, 93 | 94 | for example: 95 | 96 | ```js 97 | import { IconHome } from "@tabler/icons-vue"; 98 | 99 | //`id value must be unique` 100 | export const menuItems = [ 101 | { 102 | id: 4, 103 | title: "Post", 104 | routeName: "posts", 105 | component: "Post", 106 | icon: IconHome 107 | } 108 | ] 109 | ``` 110 | 111 | then run `npm run dev` to rebuild 112 | 113 | ### Optional to publish config 114 | 115 | ```bash 116 | php artisan vendor:publish --tag='vien-config' 117 | ``` 118 | 119 | ### Optional to publish generator stubs 120 | 121 | ```bash 122 | php artisan vendor:publish --tag='vien-stubs' 123 | ``` 124 | 125 | ### Security 126 | 127 | If you've found a bug regarding security please mail [jardik.oryza@gmail.com](mailto:jardik.oryza@gmail.com) instead of 128 | using the issue tracker. 129 | 130 | ## License 131 | 132 | The MIT License (MIT). Please see [License File](LICENSE.md) for more information. -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jhonoryza/laravel-vien", 3 | "description": "laravel vue inertia component", 4 | "type": "library", 5 | "license": "MIT", 6 | "autoload": { 7 | "psr-4": { 8 | "Jhonoryza\\Vien\\": "src/" 9 | } 10 | }, 11 | "extra": { 12 | "laravel": { 13 | "providers": [ 14 | "Jhonoryza\\Vien\\VienServiceProvider" 15 | ] 16 | } 17 | }, 18 | "authors": [ 19 | { 20 | "name": "fajar sp", 21 | "email": "jardik.oryza@gmail.com" 22 | } 23 | ], 24 | "minimum-stability": "dev", 25 | "prefer-stable": true, 26 | "require": { 27 | "php": "^8.2", 28 | "illuminate/support": "^10.0|^11.0", 29 | "illuminate/console": "^10.0|^11.0", 30 | "laravel/pint": "^1.17" 31 | }, 32 | "require-dev": { 33 | "orchestra/testbench": "^8.0|^9.0" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /config/laravel-vien.php: -------------------------------------------------------------------------------- 1 | [ 5 | 'route_path' => 'routes' . DIRECTORY_SEPARATOR . 'web.php', 6 | 7 | 'controller' => [ 8 | 'namespace' => 'App\\Http\\Controllers', 9 | 'path' => 'app' . DIRECTORY_SEPARATOR . 'Http' . DIRECTORY_SEPARATOR . 'Controllers', 10 | ], 11 | 12 | 'view' => [ 13 | 'path' => 'resources' . DIRECTORY_SEPARATOR . 'js' . DIRECTORY_SEPARATOR . 'Pages' . DIRECTORY_SEPARATOR, 14 | ], 15 | 16 | 'model' => [ 17 | 'namespace' => 'App\\Models', 18 | 'path' => 'app' . DIRECTORY_SEPARATOR . 'Models', 19 | ], 20 | ], 21 | ]; 22 | -------------------------------------------------------------------------------- /docs/select-simple.md: -------------------------------------------------------------------------------- 1 | Select Simple component usage example: 2 | 3 |

4 | 5 |

6 | 7 | `Create.vue` 8 | 9 | ```html 10 | 47 | 107 | -------------------------------------------------------------------------------- /src/Generator/Stubs/edit.stub: -------------------------------------------------------------------------------- 1 | 36 | 93 | -------------------------------------------------------------------------------- /src/Generator/Stubs/index.stub: -------------------------------------------------------------------------------- 1 | 21 | 22 | 156 | -------------------------------------------------------------------------------- /src/Generator/Stubs/show.stub: -------------------------------------------------------------------------------- 1 | 22 | 65 | -------------------------------------------------------------------------------- /src/VienServiceProvider.php: -------------------------------------------------------------------------------- 1 | mergeConfigFrom(__DIR__ . '/../config/laravel-vien.php', 'laravel-vien'); 15 | } 16 | 17 | public function boot(): void 18 | { 19 | if (! $this->app->runningInConsole()) { 20 | return; 21 | } 22 | 23 | $this->publishes([ 24 | __DIR__ . '/../config/laravel-vien.php' => config_path('laravel-vien.php'), 25 | ], 'vien-config'); 26 | 27 | $this->publishes([ 28 | __DIR__ . '/Generators/Stubs' => base_path('stubs/vien_generator'), 29 | ], 'vien-stubs'); 30 | 31 | $this->commands([ 32 | InstallCommand::class, 33 | GeneratorCommand::class, 34 | UpdateCommand::class, 35 | ]); 36 | } 37 | 38 | public function provides(): array 39 | { 40 | return [ 41 | InstallCommand::class, 42 | GeneratorCommand::class, 43 | UpdateCommand::class, 44 | ]; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /stubs/inertia-vue/Controllers/SettingController.php: -------------------------------------------------------------------------------- 1 | select('id', 'key', 'value', 'created_at') 23 | ->when(request('filter.search'), function (Builder $query, $search) { 24 | $query->where(function (Builder $query) use ($search) { 25 | $query->where('key', 'like', "%{$search}%") 26 | ->orWhere('value', 'like', "%{$search}%"); 27 | }); 28 | }) 29 | ->when( 30 | request('filter.key'), 31 | fn (Builder $query, $filter) => $query->where('key', 'like', "%{$filter}%") 32 | ) 33 | ->when( 34 | request('filter.value'), 35 | fn (Builder $query, $filter) => $query->where('value', $filter) 36 | ) 37 | ->when( 38 | request('sort'), 39 | fn (Builder $query, $sort) => $query->orderBy($sort[0] == '-' ? ltrim($sort, '-') : $sort, $sort[0] == '-' ? 'desc' : 'asc'), 40 | fn (Builder $query) => $query->orderBy('id', 'asc'), 41 | ); 42 | 43 | /** @var Collection $paginated */ 44 | $paginated = $builder 45 | ->clone() 46 | ->paginate(perPage: $limit, page: $page); 47 | // ->cursorPaginate(perPage: $limit, cursorName: 'page'); 48 | 49 | $data = $paginated 50 | ->through(fn ($item) => [ 51 | 'id' => $item->id, 52 | 'key' => $item->key, 53 | 'value' => $item->value, 54 | 'created_at' => $item->created_at, 55 | ]) 56 | ->withQueryString(); 57 | 58 | return Inertia::render('Setting/Index', [ 59 | 'table' => [ 60 | 'settings' => $data, 61 | 'pageOptions' => $this->pageOptions, 62 | 'limit' => $data->perPage(), 63 | 'allIds' => method_exists($paginated, 'total') ? $builder->select('id')->pluck('id')->toArray() : [], 64 | 'columns' => [ 65 | ['key' => 'id', 'label' => 'ID', 'visible' => true, 'sortable' => true], 66 | ['key' => 'key', 'label' => 'Key', 'visible' => true, 'sortable' => true], 67 | ['key' => 'value', 'label' => 'Value', 'visible' => true, 'sortable' => true], 68 | ['key' => 'created_at', 'label' => 'Created At', 'visible' => true, 'sortable' => true], 69 | ], 70 | 'filters' => ['key', 'value', 'search'], 71 | 'defaultSort' => '-created_at', 72 | ], 73 | ]); 74 | } 75 | 76 | /** 77 | * Show the form for creating a new resource. 78 | */ 79 | public function create() 80 | { 81 | return Inertia::render('Setting/Create'); 82 | } 83 | 84 | /** 85 | * Store a newly created resource in storage. 86 | */ 87 | public function store(Request $request) 88 | { 89 | $data = $request->validate([ 90 | 'key' => 'required|string|max:255|unique:settings', 91 | 'value' => 'required|string|max:255', 92 | ]); 93 | $model = Setting::query()->create($data); 94 | 95 | session()->flash('message', [ 96 | 'message' => "Buat setting {$model->id} berhasil.", 97 | 'type' => 'success', 98 | ]); 99 | 100 | return redirect()->route('settings.show', $model->id); 101 | } 102 | 103 | /** 104 | * Display the specified resource. 105 | */ 106 | public function show(Setting $setting) 107 | { 108 | return Inertia::render('Setting/Show', [ 109 | 'setting' => [ 110 | 'id' => $setting->id, 111 | 'key' => $setting->key, 112 | 'value' => $setting->value, 113 | 'created_at' => $setting->created_at->format('d/m/Y H:i'), 114 | ], 115 | ]); 116 | } 117 | 118 | /** 119 | * Show the form for editing the specified resource. 120 | */ 121 | public function edit(Setting $setting) 122 | { 123 | return Inertia::render('Setting/Edit', [ 124 | 'setting' => [ 125 | 'id' => $setting->id, 126 | 'key' => $setting->key, 127 | 'value' => $setting->value, 128 | 'created_at' => $setting->created_at->format('d/m/Y H:i'), 129 | ], 130 | ]); 131 | } 132 | 133 | /** 134 | * Update the specified resource in storage. 135 | */ 136 | public function update(Request $request, Setting $setting) 137 | { 138 | $data = $request->validate([ 139 | 'key' => 'required|string|max:255|unique:settings,id,' . $setting->id, 140 | 'value' => 'required|string|max:255', 141 | ]); 142 | 143 | $setting->fill($data)->save(); 144 | 145 | session()->flash('message', [ 146 | 'message' => 'Update setting berhasil.', 147 | 'type' => 'success', 148 | ]); 149 | 150 | return redirect()->back(); 151 | } 152 | 153 | /** 154 | * Remove the specified resource from storage. 155 | */ 156 | public function destroy(Setting $setting) 157 | { 158 | $setting->delete(); 159 | 160 | session()->flash('message', [ 161 | 'message' => "Setting id {$setting->id} berhasil dihapus.", 162 | 'type' => 'success', 163 | ]); 164 | 165 | return redirect()->back(); 166 | } 167 | 168 | public function bulkDestroy(Request $request) 169 | { 170 | $request->validate([ 171 | 'ids' => 'required|array', 172 | 'ids.*' => 'required|exists:settings,id', 173 | ]); 174 | Setting::query()->whereIn('id', $request->ids)->delete(); 175 | 176 | $idsString = collect($request->ids)->implode(','); 177 | session()->flash('message', [ 178 | 'message' => "Setting id {$idsString} berhasil dihapus.", 179 | 'type' => 'success', 180 | ]); 181 | 182 | return redirect()->back(); 183 | } 184 | } 185 | -------------------------------------------------------------------------------- /stubs/inertia-vue/Controllers/UserController.php: -------------------------------------------------------------------------------- 1 | select('id', 'name', 'email', 'created_at') 22 | ->when(request('filter.search'), function (Builder $query, $search) { 23 | $query->where(function (Builder $query) use ($search) { 24 | $query->where('name', 'like', "%{$search}%") 25 | ->orWhere('email', 'like', "%{$search}%"); 26 | }); 27 | }) 28 | ->when( 29 | request('filter.name'), 30 | fn (Builder $query, $name) => $query->where('name', 'like', "%{$name}%") 31 | ) 32 | ->when( 33 | request('filter.email'), 34 | fn (Builder $query, $email) => $query->where('email', $email) 35 | ) 36 | ->when( 37 | request('sort'), 38 | fn (Builder $query, $sort) => $query->orderBy($sort[0] == '-' ? ltrim($sort, '-') : $sort, $sort[0] == '-' ? 'desc' : 'asc'), 39 | fn (Builder $query) => $query->orderBy('id', 'asc'), 40 | ); 41 | 42 | /** @var Collection $paginated */ 43 | $paginated = $builder 44 | ->clone() 45 | ->simplePaginate(perPage: $limit, page: $page); 46 | // ->cursorPaginate(perPage: $limit, cursorName: 'page'); 47 | 48 | $data = $paginated 49 | ->through(fn ($user) => [ 50 | 'id' => $user->id, 51 | 'name' => $user->name, 52 | 'email' => $user->email, 53 | 'created_at' => $user->created_at, 54 | ]) 55 | ->withQueryString(); 56 | 57 | return Inertia::render('User/Index', [ 58 | 'table' => [ 59 | 'users' => $data, 60 | 'pageOptions' => $this->pageOptions, 61 | 'limit' => $data->perPage(), 62 | 'allIds' => method_exists($paginated, 'total') ? $builder->select('id')->pluck('id')->toArray() : [], 63 | 'columns' => [ 64 | ['key' => 'id', 'label' => 'ID', 'visible' => true, 'sortable' => true], 65 | ['key' => 'name', 'label' => 'Name', 'visible' => true, 'sortable' => true], 66 | ['key' => 'email', 'label' => 'Email', 'visible' => true, 'sortable' => true], 67 | ['key' => 'created_at', 'label' => 'Created At', 'visible' => true, 'sortable' => true], 68 | ], 69 | 'filters' => ['name', 'email', 'search'], 70 | 'defaultSort' => '-created_at', 71 | ], 72 | ]); 73 | } 74 | 75 | /** 76 | * Show the form for creating a new resource. 77 | */ 78 | public function create() 79 | { 80 | return Inertia::render('User/Create'); 81 | } 82 | 83 | /** 84 | * Store a newly created resource in storage. 85 | */ 86 | public function store(Request $request) 87 | { 88 | $data = $request->validate([ 89 | 'name' => 'required|string|max:255', 90 | 'email' => 'required|string|email|max:255|unique:users', 91 | 'password' => 'required|string|min:8|max:255|confirmed', 92 | ]); 93 | $user = User::query()->create($data); 94 | 95 | session()->flash('message', [ 96 | 'message' => "Buat user {$user->id} berhasil.", 97 | 'type' => 'success', 98 | ]); 99 | 100 | return redirect()->route('users.index'); 101 | } 102 | 103 | /** 104 | * Display the specified resource. 105 | */ 106 | public function show(User $user) 107 | { 108 | return Inertia::render('User/Show', [ 109 | 'user' => [ 110 | 'id' => $user->id, 111 | 'name' => $user->name, 112 | 'email' => $user->email, 113 | 'created_at' => $user->created_at->format('d/m/Y H:i'), 114 | ], 115 | ]); 116 | } 117 | 118 | /** 119 | * Show the form for editing the specified resource. 120 | */ 121 | public function edit(User $user) 122 | { 123 | return Inertia::render('User/Edit', [ 124 | 'user' => [ 125 | 'id' => $user->id, 126 | 'name' => $user->name, 127 | 'email' => $user->email, 128 | 'created_at' => $user->created_at->format('d/m/Y H:i'), 129 | ], 130 | ]); 131 | } 132 | 133 | /** 134 | * Update the specified resource in storage. 135 | */ 136 | public function update(Request $request, User $user) 137 | { 138 | $data = $request->validate([ 139 | 'name' => 'required|string|max:255', 140 | 'email' => 'required|string|email|max:255|unique:users,id,' . $user->id, 141 | 'password' => 'nullable|string|min:8|max:255|confirmed', 142 | ]); 143 | 144 | if (empty($data['password'])) { 145 | unset($data['password']); 146 | } else { 147 | $data['password'] = bcrypt($data['password']); 148 | } 149 | $user->fill($data)->save(); 150 | 151 | session()->flash('message', [ 152 | 'message' => 'Update user berhasil.', 153 | 'type' => 'success', 154 | ]); 155 | 156 | return redirect()->back(); 157 | } 158 | 159 | /** 160 | * Remove the specified resource from storage. 161 | */ 162 | public function destroy(User $user) 163 | { 164 | $user->delete(); 165 | 166 | session()->flash('message', [ 167 | 'message' => "User id {$user->id} berhasil dihapus.", 168 | 'type' => 'success', 169 | ]); 170 | 171 | return redirect()->back(); 172 | } 173 | 174 | public function bulkDestroy(Request $request) 175 | { 176 | $request->validate([ 177 | 'ids' => 'required|array', 178 | 'ids.*' => 'required|exists:users,id', 179 | ]); 180 | User::query()->whereIn('id', $request->ids)->delete(); 181 | 182 | $idsString = collect($request->ids)->implode(','); 183 | session()->flash('message', [ 184 | 'message' => "User id {$idsString} berhasil dihapus.", 185 | 'type' => 'success', 186 | ]); 187 | 188 | return redirect()->back(); 189 | } 190 | } 191 | -------------------------------------------------------------------------------- /stubs/inertia-vue/Default/AuthenticatedLayout.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 143 | -------------------------------------------------------------------------------- /stubs/inertia-vue/Default/app.css: -------------------------------------------------------------------------------- 1 | @import url("https://fonts.googleapis.com/css2?family=Quicksand:wght@300..700&display=swap"); 2 | 3 | @tailwind base; 4 | @tailwind components; 5 | @tailwind utilities; 6 | -------------------------------------------------------------------------------- /stubs/inertia-vue/Default/app.js: -------------------------------------------------------------------------------- 1 | import './bootstrap'; 2 | import '../css/app.css'; 3 | 4 | import { createApp, h } from 'vue'; 5 | import { createInertiaApp } from '@inertiajs/vue3'; 6 | import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers'; 7 | import { ZiggyVue } from '../../vendor/tightenco/ziggy'; 8 | import VueClickAway from "vue3-click-away"; 9 | 10 | const appName = import.meta.env.VITE_APP_NAME || 'Laravel'; 11 | 12 | createInertiaApp({ 13 | title: (title) => `${title} - ${appName}`, 14 | resolve: (name) => resolvePageComponent(`./Pages/${name}.vue`, import.meta.glob('./Pages/**/*.vue')), 15 | setup({ el, App, props, plugin }) { 16 | return createApp({ render: () => h(App, props) }) 17 | .use(plugin) 18 | .use(ZiggyVue) 19 | .use(VueClickAway) 20 | .mount(el); 21 | }, 22 | progress: { 23 | color: '#4B5563', 24 | }, 25 | }); 26 | -------------------------------------------------------------------------------- /stubs/inertia-vue/Default/tailwind.config.js: -------------------------------------------------------------------------------- 1 | import defaultTheme from "tailwindcss/defaultTheme"; 2 | import forms from "@tailwindcss/forms"; 3 | 4 | /** @type {import('tailwindcss').Config} */ 5 | export default { 6 | content: [ 7 | "./vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php", 8 | "./storage/framework/views/*.php", 9 | "./resources/views/**/*.blade.php", 10 | "./resources/js/**/*.vue", 11 | ], 12 | 13 | darkMode: "class", 14 | 15 | theme: { 16 | extend: { 17 | fontFamily: { 18 | sans: ["Quicksand", "Figtree", ...defaultTheme.fontFamily.sans], 19 | }, 20 | }, 21 | }, 22 | 23 | plugins: [forms], 24 | }; 25 | -------------------------------------------------------------------------------- /stubs/inertia-vue/Middleware/HandleInertiaRequests.php: -------------------------------------------------------------------------------- 1 | 29 | */ 30 | public function share(Request $request): array 31 | { 32 | return [ 33 | ...parent::share($request), 34 | 'auth' => [ 35 | 'user' => $request->user(), 36 | ], 37 | 'flash' => [ 38 | 'message' => $request->session()->get('message'), 39 | ], 40 | ]; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /stubs/inertia-vue/Models/Setting.php: -------------------------------------------------------------------------------- 1 | 2 | import AuthenticatedLayout from "@/Layouts/AuthenticatedLayout.vue"; 3 | import Container from "@/Components/Vien/Container.vue"; 4 | import InputError from "@/Components/InputError.vue"; 5 | import InputLabel from "@/Components/InputLabel.vue"; 6 | import PrimaryButton from "@/Components/PrimaryButton.vue"; 7 | import TextInput from "@/Components/TextInput.vue"; 8 | import { useForm } from "@inertiajs/vue3"; 9 | import { IconChevronRight } from "@tabler/icons-vue"; 10 | import { Head } from "@inertiajs/vue3"; 11 | 12 | const form = useForm({ 13 | key: "", 14 | value: "", 15 | }); 16 | 17 | const createNewSetting = () => { 18 | form.post(route("settings.store"), { 19 | preserveState: true, 20 | onSuccess: () => form.reset(), 21 | }); 22 | }; 23 | 24 | 103 | -------------------------------------------------------------------------------- /stubs/inertia-vue/Pages/Setting/Edit.vue: -------------------------------------------------------------------------------- 1 | 30 | 109 | -------------------------------------------------------------------------------- /stubs/inertia-vue/Pages/Setting/Index.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 168 | -------------------------------------------------------------------------------- /stubs/inertia-vue/Pages/Setting/Show.vue: -------------------------------------------------------------------------------- 1 | 16 | 91 | -------------------------------------------------------------------------------- /stubs/inertia-vue/Pages/User/Create.vue: -------------------------------------------------------------------------------- 1 | 35 | 152 | -------------------------------------------------------------------------------- /stubs/inertia-vue/Pages/User/Edit.vue: -------------------------------------------------------------------------------- 1 | 41 | 158 | -------------------------------------------------------------------------------- /stubs/inertia-vue/Pages/User/Index.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 167 | -------------------------------------------------------------------------------- /stubs/inertia-vue/Pages/User/Show.vue: -------------------------------------------------------------------------------- 1 | 16 | 90 | -------------------------------------------------------------------------------- /stubs/inertia-vue/Vien/AppToast.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 33 | -------------------------------------------------------------------------------- /stubs/inertia-vue/Vien/Button.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 10 | 11 | 44 | -------------------------------------------------------------------------------- /stubs/inertia-vue/Vien/Checkbox.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 77 | -------------------------------------------------------------------------------- /stubs/inertia-vue/Vien/Container.vue: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /stubs/inertia-vue/Vien/DeleteModal.vue: -------------------------------------------------------------------------------- 1 | 37 | 38 | 59 | -------------------------------------------------------------------------------- /stubs/inertia-vue/Vien/InputDateTime.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 50 | 51 | 57 | -------------------------------------------------------------------------------- /stubs/inertia-vue/Vien/InputText.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 33 | -------------------------------------------------------------------------------- /stubs/inertia-vue/Vien/Loading.vue: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 18 | 19 | 48 | -------------------------------------------------------------------------------- /stubs/inertia-vue/Vien/Pagination.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 73 | -------------------------------------------------------------------------------- /stubs/inertia-vue/Vien/SelectSimple.vue: -------------------------------------------------------------------------------- 1 | 35 | 36 | 51 | -------------------------------------------------------------------------------- /stubs/inertia-vue/Vien/SideBar.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 23 | -------------------------------------------------------------------------------- /stubs/inertia-vue/Vien/SideBarMenuItem.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 36 | -------------------------------------------------------------------------------- /stubs/inertia-vue/Vien/SideBarSubMenuItem.vue: -------------------------------------------------------------------------------- 1 | 32 | 33 | 81 | -------------------------------------------------------------------------------- /stubs/inertia-vue/Vien/Table.vue: -------------------------------------------------------------------------------- 1 | 82 | 83 | 447 | -------------------------------------------------------------------------------- /stubs/inertia-vue/Vien/TextArea.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 |