├── .editorconfig
├── .env.example
├── .gitattributes
├── .gitignore
├── README.md
├── app
├── Console
│ └── Kernel.php
├── Enums
│ ├── OrderStatusEnum.php
│ └── ProductTypeEnum.php
├── Exceptions
│ └── Handler.php
├── Filament
│ ├── Resources
│ │ ├── BrandResource.php
│ │ ├── BrandResource
│ │ │ ├── Pages
│ │ │ │ ├── CreateBrand.php
│ │ │ │ ├── EditBrand.php
│ │ │ │ └── ListBrands.php
│ │ │ └── RelationManagers
│ │ │ │ └── ProductsRelationManager.php
│ │ ├── CategoryResource.php
│ │ ├── CategoryResource
│ │ │ ├── Pages
│ │ │ │ ├── CreateCategory.php
│ │ │ │ ├── EditCategory.php
│ │ │ │ └── ListCategories.php
│ │ │ └── RelationManagers
│ │ │ │ └── ProductsRelationManager.php
│ │ ├── CustomerResource.php
│ │ ├── CustomerResource
│ │ │ └── Pages
│ │ │ │ ├── CreateCustomer.php
│ │ │ │ ├── EditCustomer.php
│ │ │ │ └── ListCustomers.php
│ │ ├── OrderResource.php
│ │ ├── OrderResource
│ │ │ └── Pages
│ │ │ │ ├── CreateOrder.php
│ │ │ │ ├── EditOrder.php
│ │ │ │ └── ListOrders.php
│ │ ├── ProductResource.php
│ │ └── ProductResource
│ │ │ └── Pages
│ │ │ ├── CreateProduct.php
│ │ │ ├── EditProduct.php
│ │ │ └── ListProducts.php
│ └── Widgets
│ │ ├── LatestOrders.php
│ │ ├── OrdersChart.php
│ │ ├── ProductsChart.php
│ │ └── StatsOverview.php
├── Http
│ ├── Controllers
│ │ └── Controller.php
│ ├── Kernel.php
│ └── Middleware
│ │ ├── Authenticate.php
│ │ ├── EncryptCookies.php
│ │ ├── PreventRequestsDuringMaintenance.php
│ │ ├── RedirectIfAuthenticated.php
│ │ ├── TrimStrings.php
│ │ ├── TrustHosts.php
│ │ ├── TrustProxies.php
│ │ ├── ValidateSignature.php
│ │ └── VerifyCsrfToken.php
├── Models
│ ├── Brand.php
│ ├── Category.php
│ ├── Customer.php
│ ├── Order.php
│ ├── OrderItem.php
│ ├── Product.php
│ └── User.php
└── Providers
│ ├── AppServiceProvider.php
│ ├── AuthServiceProvider.php
│ ├── BroadcastServiceProvider.php
│ ├── EventServiceProvider.php
│ ├── Filament
│ └── AdminPanelProvider.php
│ └── RouteServiceProvider.php
├── artisan
├── bootstrap
├── app.php
└── cache
│ └── .gitignore
├── composer.json
├── composer.lock
├── config
├── app.php
├── auth.php
├── broadcasting.php
├── cache.php
├── cors.php
├── database.php
├── filament.php
├── filesystems.php
├── hashing.php
├── logging.php
├── mail.php
├── queue.php
├── sanctum.php
├── services.php
├── session.php
└── view.php
├── database
├── .gitignore
├── factories
│ └── UserFactory.php
├── migrations
│ ├── 2014_10_12_000000_create_users_table.php
│ ├── 2014_10_12_100000_create_password_reset_tokens_table.php
│ ├── 2019_08_19_000000_create_failed_jobs_table.php
│ ├── 2019_12_14_000001_create_personal_access_tokens_table.php
│ ├── 2023_08_17_132209_create_categories_table.php
│ ├── 2023_08_17_132215_create_brands_table.php
│ ├── 2023_08_17_132244_create_products_table.php
│ ├── 2023_08_17_132249_create_customers_table.php
│ ├── 2023_08_17_132319_create_orders_table.php
│ ├── 2023_08_17_135532_create_order_items_table.php
│ ├── 2023_08_17_135924_create_category_product_table.php
│ └── 2023_09_04_131928_delete_total_price_from_orders_table.php
└── seeders
│ └── DatabaseSeeder.php
├── package.json
├── phpunit.xml
├── public
├── .htaccess
├── css
│ ├── filament
│ │ ├── filament
│ │ │ └── app.css
│ │ ├── forms
│ │ │ └── forms.css
│ │ └── support
│ │ │ └── support.css
│ └── pxlrbt
│ │ └── filament-spotlight
│ │ └── spotlight-css.css
├── favicon.ico
├── images
│ ├── favicon.png
│ └── hostinger-logo.png
├── index.php
├── js
│ ├── filament
│ │ ├── filament
│ │ │ ├── app.js
│ │ │ └── echo.js
│ │ ├── forms
│ │ │ ├── components
│ │ │ │ ├── color-picker.js
│ │ │ │ ├── date-time-picker.js
│ │ │ │ ├── file-upload.js
│ │ │ │ ├── key-value.js
│ │ │ │ ├── markdown-editor.js
│ │ │ │ ├── rich-editor.js
│ │ │ │ ├── select.js
│ │ │ │ ├── tags-input.js
│ │ │ │ └── textarea.js
│ │ │ └── forms.js
│ │ ├── notifications
│ │ │ └── notifications.js
│ │ ├── support
│ │ │ ├── async-alpine.js
│ │ │ └── support.js
│ │ ├── tables
│ │ │ └── tables.js
│ │ └── widgets
│ │ │ └── components
│ │ │ ├── chart.js
│ │ │ └── stats-overview
│ │ │ └── stat
│ │ │ └── chart.js
│ └── pxlrbt
│ │ └── filament-spotlight
│ │ └── spotlight-js.js
└── robots.txt
├── resources
├── css
│ └── app.css
├── js
│ ├── app.js
│ └── bootstrap.js
└── views
│ ├── vendor
│ └── filament-panels
│ │ └── components
│ │ └── logo.blade.php
│ └── welcome.blade.php
├── routes
├── api.php
├── channels.php
├── console.php
└── web.php
├── storage
├── app
│ ├── .gitignore
│ └── public
│ │ └── .gitignore
├── framework
│ ├── .gitignore
│ ├── cache
│ │ ├── .gitignore
│ │ └── data
│ │ │ └── .gitignore
│ ├── sessions
│ │ └── .gitignore
│ ├── testing
│ │ └── .gitignore
│ └── views
│ │ └── .gitignore
└── logs
│ └── .gitignore
├── tests
├── CreatesApplication.php
├── Feature
│ └── ExampleTest.php
├── TestCase.php
└── Unit
│ └── ExampleTest.php
└── vite.config.js
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | end_of_line = lf
6 | indent_size = 4
7 | indent_style = space
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | trim_trailing_whitespace = false
13 |
14 | [*.{yml,yaml}]
15 | indent_size = 2
16 |
17 | [docker-compose.yml]
18 | indent_size = 4
19 |
--------------------------------------------------------------------------------
/.env.example:
--------------------------------------------------------------------------------
1 | APP_NAME=Laravel
2 | APP_ENV=local
3 | APP_KEY=
4 | APP_DEBUG=true
5 | APP_URL=http://localhost
6 |
7 | LOG_CHANNEL=stack
8 | LOG_DEPRECATIONS_CHANNEL=null
9 | LOG_LEVEL=debug
10 |
11 | DB_CONNECTION=mysql
12 | DB_HOST=127.0.0.1
13 | DB_PORT=3306
14 | DB_DATABASE=laravel
15 | DB_USERNAME=root
16 | DB_PASSWORD=
17 |
18 | BROADCAST_DRIVER=log
19 | CACHE_DRIVER=file
20 | FILESYSTEM_DISK=local
21 | QUEUE_CONNECTION=sync
22 | SESSION_DRIVER=file
23 | SESSION_LIFETIME=120
24 |
25 | MEMCACHED_HOST=127.0.0.1
26 |
27 | REDIS_HOST=127.0.0.1
28 | REDIS_PASSWORD=null
29 | REDIS_PORT=6379
30 |
31 | MAIL_MAILER=smtp
32 | MAIL_HOST=mailpit
33 | MAIL_PORT=1025
34 | MAIL_USERNAME=null
35 | MAIL_PASSWORD=null
36 | MAIL_ENCRYPTION=null
37 | MAIL_FROM_ADDRESS="hello@example.com"
38 | MAIL_FROM_NAME="${APP_NAME}"
39 |
40 | AWS_ACCESS_KEY_ID=
41 | AWS_SECRET_ACCESS_KEY=
42 | AWS_DEFAULT_REGION=us-east-1
43 | AWS_BUCKET=
44 | AWS_USE_PATH_STYLE_ENDPOINT=false
45 |
46 | PUSHER_APP_ID=
47 | PUSHER_APP_KEY=
48 | PUSHER_APP_SECRET=
49 | PUSHER_HOST=
50 | PUSHER_PORT=443
51 | PUSHER_SCHEME=https
52 | PUSHER_APP_CLUSTER=mt1
53 |
54 | VITE_APP_NAME="${APP_NAME}"
55 | VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
56 | VITE_PUSHER_HOST="${PUSHER_HOST}"
57 | VITE_PUSHER_PORT="${PUSHER_PORT}"
58 | VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
59 | VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
60 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto eol=lf
2 |
3 | *.blade.php diff=html
4 | *.css diff=css
5 | *.html diff=html
6 | *.md diff=markdown
7 | *.php diff=php
8 |
9 | /.github export-ignore
10 | CHANGELOG.md export-ignore
11 | .styleci.yml export-ignore
12 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /.phpunit.cache
2 | /node_modules
3 | /public/build
4 | /public/hot
5 | /public/storage
6 | /storage/*.key
7 | /vendor
8 | .env
9 | .env.backup
10 | .env.production
11 | .phpunit.result.cache
12 | Homestead.json
13 | Homestead.yaml
14 | auth.json
15 | npm-debug.log
16 | yarn-error.log
17 | /.fleet
18 | /.idea
19 | /.vscode
20 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Mastering FilamentPHP v3 for Beginners
2 |
3 | This repository is a collection of code that accompanies a [video series](https://www.youtube.com/watch?v=fOEpPhztORo&list=PLFHz2csJcgk_M6tg-f589Myy-lbLyACKi) on YouTube about FilamentPHP, a modern, open-source, and community-driven PHP framework. The video series covers various aspects of the framework, including installation, configuration, and usage.
4 | • Twitter: [@codewithdary](https://twitter.com/codewithdary)
5 | • Instagram: [@codewithdary](https://www.instagram.com/codewithdary/)
6 | • TikTok: [@codewithdary](https://tiktok.com/@codewithdary)
7 | • Blog: [@codewithdary](https://blog.codewithdary.com)
8 | • Patreon: [@codewithdary](https://www.patreon.com/user?u=30307830)
9 |
10 |
11 | ## Video Chapters
12 |
13 | | Chapter | Title |
14 | |---------| --- |
15 | | 1 | Introduction & Setup FilamentPHP |
16 | | 2 | How to Customize FilamentPHP its Theme to Your Own |
17 | | 3 | Building Our Ecommerce Migrations & Models |
18 | | 4 | How to Build Resources in FilamentPHP |
19 | | 5 | Resource Modifiers & Resource Filters in FilamentPHP |
20 | | 6 | What are Actions & How to Use Them in FilamentPHP |
21 | | 7 | Building Our Customer, Order & Category Resources in Filamentphp |
22 | | 8 | How to Setup The Global Search in FilamentPHP |
23 | | 9 | How to Customize The Navbar in FilamentPHP |
24 | | 10 | How to Define Relationships in FilamentPHP |
25 | | 11 | How to Create a Dashboard Using Widgets, Charts & Tables |
26 | | 12 | Configure Plugins from FilamentPHP |
27 | | 13 | How to Deploy a FilamentPHP Project on Hostinger |
28 |
29 | ## Simple Deploy Script
30 | ```
31 | git pull
32 | cp .env.example .env
33 | php artisan key:generate
34 | composer install --no-dev --optimize-autoloader
35 | php artisan optimize
36 | php artisan route:cache
37 | php artisan cache:clear
38 | php artisan migrate
39 | ```
40 |
41 | ## .htaccess script
42 | ```
43 |
44 | RewriteEngine On
45 | RewriteRule ^(.*)$ public/$1 [L]
46 |
47 | ```
48 |
49 | For more information about FilamentPHP, please visit the [official website](https://filamentphp.com/).
50 |
--------------------------------------------------------------------------------
/app/Console/Kernel.php:
--------------------------------------------------------------------------------
1 | command('inspire')->hourly();
16 | }
17 |
18 | /**
19 | * Register the commands for the application.
20 | */
21 | protected function commands(): void
22 | {
23 | $this->load(__DIR__.'/Commands');
24 |
25 | require base_path('routes/console.php');
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/Enums/OrderStatusEnum.php:
--------------------------------------------------------------------------------
1 |
14 | */
15 | protected $dontFlash = [
16 | 'current_password',
17 | 'password',
18 | 'password_confirmation',
19 | ];
20 |
21 | /**
22 | * Register the exception handling callbacks for the application.
23 | */
24 | public function register(): void
25 | {
26 | $this->reportable(function (Throwable $e) {
27 | //
28 | });
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/Filament/Resources/BrandResource.php:
--------------------------------------------------------------------------------
1 | schema([
31 | Forms\Components\Group::make()
32 | ->schema([
33 | Forms\Components\Section::make([
34 | Forms\Components\TextInput::make('name')
35 | ->required()
36 | ->live(onBlur: true)
37 | ->unique()
38 | ->afterStateUpdated(function(string $operation, $state, Forms\Set $set) {
39 | if ($operation !== 'create') {
40 | return;
41 | }
42 |
43 | $set('slug', Str::slug($state));
44 | }),
45 |
46 | Forms\Components\TextInput::make('slug')
47 | ->disabled()
48 | ->dehydrated()
49 | ->required()
50 | ->unique(),
51 |
52 | Forms\Components\TextInput::make('url')
53 | ->label('Website URL')
54 | ->required()
55 | ->unique()
56 | ->columnSpan('full'),
57 |
58 | Forms\Components\MarkdownEditor::make('description')
59 | ->columnSpan('full')
60 | ])->columns(2)
61 | ]),
62 |
63 | Forms\Components\Group::make()
64 | ->schema([
65 | Forms\Components\Section::make('Status')
66 | ->schema([
67 | Forms\Components\Toggle::make('is_visible')
68 | ->label('Visibility')
69 | ->helperText('Enable or disable brand visibility')
70 | ->default(true),
71 | ]),
72 |
73 | Forms\Components\Group::make()
74 | ->schema([
75 | Forms\Components\Section::make('Color')
76 | ->schema([
77 | Forms\Components\ColorPicker::make('primary_hex')
78 | ->label('Primary Color')
79 | ])
80 | ])
81 | ])
82 | ]);
83 | }
84 |
85 | public static function table(Table $table): Table
86 | {
87 | return $table
88 | ->columns([
89 | Tables\Columns\TextColumn::make('name')
90 | ->searchable()
91 | ->sortable(),
92 |
93 | Tables\Columns\TextColumn::make('url')
94 | ->label('Website URL')
95 | ->sortable()
96 | ->searchable(),
97 |
98 | Tables\Columns\ColorColumn::make('primary_hex')
99 | ->label('Primary Color'),
100 |
101 | Tables\Columns\IconColumn::make('is_visible')
102 | ->boolean()
103 | ->sortable()
104 | ->label('Visibility'),
105 |
106 | Tables\Columns\TextColumn::make('updated_at')
107 | ->date()
108 | ->sortable(),
109 | ])
110 | ->filters([
111 | //
112 | ])
113 | ->actions([
114 | Tables\Actions\ActionGroup::make([
115 | Tables\Actions\ViewAction::make(),
116 | Tables\Actions\EditAction::make(),
117 | Tables\Actions\DeleteAction::make()
118 | ])
119 | ])
120 | ->bulkActions([
121 | Tables\Actions\BulkActionGroup::make([
122 | Tables\Actions\DeleteBulkAction::make(),
123 | ]),
124 | ])
125 | ->emptyStateActions([
126 | Tables\Actions\CreateAction::make(),
127 | ]);
128 | }
129 |
130 | public static function getRelations(): array
131 | {
132 | return [
133 | RelationManagers\ProductsRelationManager::class
134 | ];
135 | }
136 |
137 | public static function getPages(): array
138 | {
139 | return [
140 | 'index' => Pages\ListBrands::route('/'),
141 | 'create' => Pages\CreateBrand::route('/create'),
142 | 'edit' => Pages\EditBrand::route('/{record}/edit'),
143 | ];
144 | }
145 | }
146 |
--------------------------------------------------------------------------------
/app/Filament/Resources/BrandResource/Pages/CreateBrand.php:
--------------------------------------------------------------------------------
1 | schema([
24 | Forms\Components\Tabs::make('Products')
25 | ->tabs([
26 | Forms\Components\Tabs\Tab::make('Information')
27 | ->schema([
28 | Forms\Components\TextInput::make('name')
29 | ->required()
30 | ->live(onBlur: true)
31 | ->afterStateUpdated(function(string $operation, $state, Forms\Set $set) {
32 | if ($operation !== 'create') {
33 | return;
34 | }
35 |
36 | $set('slug', Str::slug($state));
37 | }),
38 |
39 | Forms\Components\TextInput::make('slug')
40 | ->disabled()
41 | ->dehydrated()
42 | ->required()
43 | ->unique(Product::class, 'slug', ignoreRecord: true),
44 |
45 | Forms\Components\MarkdownEditor::make('description')
46 | ->columnSpan('full')
47 | ])->columns(),
48 | Forms\Components\Tabs\Tab::make('Pricing & Inventory')
49 | ->schema([
50 | Forms\Components\TextInput::make('sku')
51 | ->label("SKU (Stock Keeping Unit)")
52 | ->required(),
53 |
54 | Forms\Components\TextInput::make('price')
55 | ->numeric()
56 | ->rules('regex:/^\d{1,6}(\.\d{0,2})?$/')
57 | ->required(),
58 |
59 | Forms\Components\TextInput::make('quantity')
60 | ->numeric()
61 | ->minValue(0)
62 | ->maxValue(100)
63 | ->required(),
64 |
65 | Forms\Components\Select::make('type')
66 | ->options([
67 | 'downloadable' => ProductTypeEnum::DOWNLOADABLE->value,
68 | 'deliverable' => ProductTypeEnum::DELIVERABLE->value,
69 | ])->required()
70 | ])->columns(2),
71 | Forms\Components\Tabs\Tab::make('Additional Information')
72 | ->schema([
73 | Forms\Components\Toggle::make('is_visible')
74 | ->label('Visibility')
75 | ->helperText('Enable or disable product visibility')
76 | ->default(true),
77 |
78 | Forms\Components\Toggle::make('is_featured')
79 | ->label('Featured')
80 | ->helperText('Enable or disable products featured status'),
81 |
82 | Forms\Components\DatePicker::make('published_at')
83 | ->label('Availability')
84 | ->default(now()),
85 |
86 | Forms\Components\Select::make('categories')
87 | ->relationship('categories', 'name')
88 | ->multiple()
89 | ->required(),
90 |
91 | Forms\Components\FileUpload::make('image')
92 | ->directory('form-attachments')
93 | ->preserveFilenames()
94 | ->image()
95 | ->imageEditor()
96 | ->columnSpanFull()
97 | ])->columns(2)
98 | ])->columnSpanFull()
99 | ]);
100 | }
101 |
102 | public function table(Table $table): Table
103 | {
104 | return $table
105 | ->recordTitleAttribute('name')
106 | ->columns([
107 | Tables\Columns\ImageColumn::make('image'),
108 |
109 | Tables\Columns\TextColumn::make('name')
110 | ->searchable()
111 | ->sortable(),
112 |
113 | Tables\Columns\TextColumn::make('brand.name')
114 | ->searchable()
115 | ->sortable()
116 | ->toggleable(),
117 |
118 | Tables\Columns\IconColumn::make('is_visible')
119 | ->sortable()
120 | ->toggleable()
121 | ->label('Visibility')
122 | ->boolean(),
123 |
124 | Tables\Columns\TextColumn::make('price')
125 | ->sortable()
126 | ->toggleable(),
127 |
128 | Tables\Columns\TextColumn::make('quantity')
129 | ->sortable()
130 | ->toggleable(),
131 |
132 | Tables\Columns\TextColumn::make('published_at')
133 | ->date()
134 | ->sortable(),
135 |
136 | Tables\Columns\TextColumn::make('type')
137 | ])
138 | ->filters([
139 | //
140 | ])
141 | ->headerActions([
142 | Tables\Actions\CreateAction::make(),
143 | ])
144 | ->actions([
145 | Tables\Actions\ActionGroup::make([
146 | Tables\Actions\EditAction::make(),
147 | Tables\Actions\DeleteAction::make(),
148 | ])
149 | ])
150 | ->bulkActions([
151 | Tables\Actions\BulkActionGroup::make([
152 | Tables\Actions\DeleteBulkAction::make(),
153 | ]),
154 | ])
155 | ->emptyStateActions([
156 | Tables\Actions\CreateAction::make(),
157 | ]);
158 | }
159 | }
160 |
--------------------------------------------------------------------------------
/app/Filament/Resources/CategoryResource.php:
--------------------------------------------------------------------------------
1 | schema([
32 | Forms\Components\Group::make()
33 | ->schema([
34 | Forms\Components\Section::make([
35 | Forms\Components\TextInput::make('name')
36 | ->required()
37 | ->live(onBlur: true)
38 | ->unique()
39 | ->afterStateUpdated(function(string $operation, $state, Forms\Set $set) {
40 | if ($operation !== 'create') {
41 | return;
42 | }
43 |
44 | $set('slug', Str::slug($state));
45 | }),
46 |
47 | Forms\Components\TextInput::make('slug')
48 | ->disabled()
49 | ->dehydrated()
50 | ->required()
51 | ->unique(Product::class, 'slug', ignoreRecord: true),
52 |
53 | Forms\Components\MarkdownEditor::make('description')
54 | ->columnSpanFull()
55 | ])->columns(2)
56 | ]),
57 |
58 | Forms\Components\Group::make()
59 | ->schema([
60 | Forms\Components\Section::make('Status')
61 | ->schema([
62 | Forms\Components\Toggle::make('is_visible')
63 | ->label('Visibility')
64 | ->helperText('Enable or disable category visibility')
65 | ->default(true),
66 |
67 | Forms\Components\Select::make('parent_id')
68 | ->relationship('parent', 'name')
69 | ])
70 | ])
71 | ]);
72 | }
73 |
74 | public static function table(Table $table): Table
75 | {
76 | return $table
77 | ->columns([
78 | Tables\Columns\TextColumn::make('name')
79 | ->sortable()
80 | ->searchable(),
81 |
82 | Tables\Columns\TextColumn::make('parent.name')
83 | ->label('Parent')
84 | ->searchable()
85 | ->sortable(),
86 |
87 | Tables\Columns\IconColumn::make('is_visible')
88 | ->label('Visibility')
89 | ->boolean()
90 | ->sortable(),
91 |
92 | Tables\Columns\TextColumn::make('updated_at')
93 | ->date()
94 | ->label('Updated Date')
95 | ->sortable(),
96 | ])
97 | ->filters([
98 | //
99 | ])
100 | ->actions([
101 | Tables\Actions\ActionGroup::make([
102 | Tables\Actions\ViewAction::make(),
103 | Tables\Actions\EditAction::make(),
104 | Tables\Actions\DeleteAction::make()
105 | ])
106 | ])
107 | ->bulkActions([
108 | Tables\Actions\BulkActionGroup::make([
109 | Tables\Actions\DeleteBulkAction::make(),
110 | ]),
111 | ])
112 | ->emptyStateActions([
113 | Tables\Actions\CreateAction::make(),
114 | ]);
115 | }
116 |
117 | public static function getRelations(): array
118 | {
119 | return [
120 | RelationManagers\ProductsRelationManager::class
121 | ];
122 | }
123 |
124 | public static function getPages(): array
125 | {
126 | return [
127 | 'index' => Pages\ListCategories::route('/'),
128 | 'create' => Pages\CreateCategory::route('/create'),
129 | 'edit' => Pages\EditCategory::route('/{record}/edit'),
130 | ];
131 | }
132 | }
133 |
--------------------------------------------------------------------------------
/app/Filament/Resources/CategoryResource/Pages/CreateCategory.php:
--------------------------------------------------------------------------------
1 | schema([
24 | Forms\Components\Tabs::make('Products')
25 | ->tabs([
26 | Forms\Components\Tabs\Tab::make('Information')
27 | ->schema([
28 | Forms\Components\TextInput::make('name')
29 | ->required()
30 | ->live(onBlur: true)
31 | ->afterStateUpdated(function(string $operation, $state, Forms\Set $set) {
32 | if ($operation !== 'create') {
33 | return;
34 | }
35 |
36 | $set('slug', Str::slug($state));
37 | }),
38 |
39 | Forms\Components\TextInput::make('slug')
40 | ->disabled()
41 | ->dehydrated()
42 | ->required()
43 | ->unique(Product::class, 'slug', ignoreRecord: true),
44 |
45 | Forms\Components\MarkdownEditor::make('description')
46 | ->columnSpan('full')
47 | ])->columns(),
48 | Forms\Components\Tabs\Tab::make('Pricing & Inventory')
49 | ->schema([
50 | Forms\Components\TextInput::make('sku')
51 | ->label("SKU (Stock Keeping Unit)")
52 | ->required(),
53 |
54 | Forms\Components\TextInput::make('price')
55 | ->numeric()
56 | ->rules('regex:/^\d{1,6}(\.\d{0,2})?$/')
57 | ->required(),
58 |
59 | Forms\Components\TextInput::make('quantity')
60 | ->numeric()
61 | ->minValue(0)
62 | ->maxValue(100)
63 | ->required(),
64 |
65 | Forms\Components\Select::make('type')
66 | ->options([
67 | 'downloadable' => ProductTypeEnum::DOWNLOADABLE->value,
68 | 'deliverable' => ProductTypeEnum::DELIVERABLE->value,
69 | ])->required()
70 | ])->columns(2),
71 | Forms\Components\Tabs\Tab::make('Additional Information')
72 | ->schema([
73 | Forms\Components\Toggle::make('is_visible')
74 | ->label('Visibility')
75 | ->helperText('Enable or disable product visibility')
76 | ->default(true),
77 |
78 | Forms\Components\Toggle::make('is_featured')
79 | ->label('Featured')
80 | ->helperText('Enable or disable products featured status'),
81 |
82 | Forms\Components\DatePicker::make('published_at')
83 | ->label('Availability')
84 | ->default(now()),
85 |
86 | Forms\Components\Select::make('categories')
87 | ->relationship('categories', 'name')
88 | ->multiple()
89 | ->required(),
90 |
91 | Forms\Components\FileUpload::make('image')
92 | ->directory('form-attachments')
93 | ->preserveFilenames()
94 | ->image()
95 | ->imageEditor()
96 | ->columnSpanFull()
97 | ])->columns(2)
98 | ])->columnSpanFull()
99 | ]);
100 | }
101 |
102 | public function table(Table $table): Table
103 | {
104 | return $table
105 | ->recordTitleAttribute('name')
106 | ->columns([
107 | Tables\Columns\ImageColumn::make('image'),
108 |
109 | Tables\Columns\TextColumn::make('name')
110 | ->searchable()
111 | ->sortable(),
112 |
113 | Tables\Columns\TextColumn::make('brand.name')
114 | ->searchable()
115 | ->sortable()
116 | ->toggleable(),
117 |
118 | Tables\Columns\IconColumn::make('is_visible')
119 | ->sortable()
120 | ->toggleable()
121 | ->label('Visibility')
122 | ->boolean(),
123 |
124 | Tables\Columns\TextColumn::make('price')
125 | ->sortable()
126 | ->toggleable(),
127 |
128 | Tables\Columns\TextColumn::make('quantity')
129 | ->sortable()
130 | ->toggleable(),
131 |
132 | Tables\Columns\TextColumn::make('published_at')
133 | ->date()
134 | ->sortable(),
135 |
136 | Tables\Columns\TextColumn::make('type')
137 | ])
138 | ->filters([
139 | //
140 | ])
141 | ->headerActions([
142 | Tables\Actions\CreateAction::make(),
143 | ])
144 | ->actions([
145 | Tables\Actions\ActionGroup::make([
146 | Tables\Actions\EditAction::make(),
147 | Tables\Actions\DeleteAction::make()
148 | ])
149 | ])
150 | ->bulkActions([
151 | Tables\Actions\BulkActionGroup::make([
152 | Tables\Actions\DeleteBulkAction::make(),
153 | ]),
154 | ])
155 | ->emptyStateActions([
156 | Tables\Actions\CreateAction::make(),
157 | ]);
158 | }
159 | }
160 |
--------------------------------------------------------------------------------
/app/Filament/Resources/CustomerResource.php:
--------------------------------------------------------------------------------
1 | schema([
30 | Forms\Components\Section::make()
31 | ->schema([
32 | Forms\Components\TextInput::make('name')
33 | ->maxValue(50)
34 | ->required(),
35 |
36 | Forms\Components\TextInput::make('email')
37 | ->label('Email Address')
38 | ->required()
39 | ->email()
40 | ->unique(ignoreRecord: true),
41 |
42 | Forms\Components\TextInput::make('phone')
43 | ->maxValue(50),
44 |
45 | Forms\Components\DatePicker::make('date_of_birth'),
46 |
47 | Forms\Components\TextInput::make('city')
48 | ->required(),
49 |
50 | Forms\Components\TextInput::make('zip_code')
51 | ->required(),
52 |
53 | Forms\Components\TextInput::make('address')
54 | ->required()
55 | ->columnSpanFull()
56 | ])->columns(2)
57 | ]);
58 | }
59 |
60 | public static function table(Table $table): Table
61 | {
62 | return $table
63 | ->columns([
64 | Tables\Columns\TextColumn::make('name')
65 | ->sortable()
66 | ->searchable(),
67 |
68 | Tables\Columns\TextColumn::make('email')
69 | ->sortable()
70 | ->searchable(),
71 |
72 | Tables\Columns\TextColumn::make('phone')
73 | ->sortable()
74 | ->searchable(),
75 |
76 | Tables\Columns\TextColumn::make('city')
77 | ->sortable()
78 | ->searchable(),
79 |
80 | Tables\Columns\TextColumn::make('date_of_birth')
81 | ->date()
82 | ->sortable()
83 | ])
84 | ->filters([
85 | //
86 | ])
87 | ->actions([
88 | Tables\Actions\ActionGroup::make([
89 | Tables\Actions\ViewAction::make(),
90 | Tables\Actions\EditAction::make(),
91 | Tables\Actions\DeleteAction::make()
92 | ])
93 | ])
94 | ->bulkActions([
95 | Tables\Actions\BulkActionGroup::make([
96 | Tables\Actions\DeleteBulkAction::make(),
97 | ]),
98 | ])
99 | ->emptyStateActions([
100 | Tables\Actions\CreateAction::make(),
101 | ]);
102 | }
103 |
104 | public static function getRelations(): array
105 | {
106 | return [
107 | //
108 | ];
109 | }
110 |
111 | public static function getPages(): array
112 | {
113 | return [
114 | 'index' => Pages\ListCustomers::route('/'),
115 | 'create' => Pages\CreateCustomer::route('/create'),
116 | 'edit' => Pages\EditCustomer::route('/{record}/edit'),
117 | ];
118 | }
119 | }
120 |
--------------------------------------------------------------------------------
/app/Filament/Resources/CustomerResource/Pages/CreateCustomer.php:
--------------------------------------------------------------------------------
1 | count();
32 | }
33 |
34 | public static function getNavigationBadgeColor(): ?string
35 | {
36 | return static::getModel()::where('status', '=', 'processing')->count() > 10
37 | ? 'warning'
38 | : 'primary';
39 | }
40 |
41 | public static function form(Form $form): Form
42 | {
43 | return $form
44 | ->schema([
45 | Forms\Components\Wizard::make([
46 | Forms\Components\Wizard\Step::make('Order Details')
47 | ->schema([
48 | Forms\Components\TextInput::make('number')
49 | ->default('OR-' . random_int(100000, 9999999))
50 | ->disabled()
51 | ->dehydrated()
52 | ->required(),
53 |
54 | Forms\Components\Select::make('customer_id')
55 | ->relationship('customer', 'name')
56 | ->searchable()
57 | ->required(),
58 |
59 | Forms\Components\TextInput::make('shipping_price')
60 | ->label('Shipping Costs')
61 | ->dehydrated()
62 | ->numeric()
63 | ->required(),
64 |
65 | Forms\Components\Select::make('type')
66 | ->options([
67 | 'pending' => OrderStatusEnum::PENDING->value,
68 | 'processing' => OrderStatusEnum::PROCESSING->value,
69 | 'completed' => OrderStatusEnum::COMPLETED->value,
70 | 'declined' => OrderStatusEnum::DECLINED->value,
71 | ])->required(),
72 |
73 | Forms\Components\MarkdownEditor::make('notes')
74 | ->columnSpanFull()
75 | ])->columns(2),
76 | Forms\Components\Wizard\Step::make('Order Items')
77 | ->schema([
78 | Forms\Components\Repeater::make('items')
79 | ->relationship()
80 | ->schema([
81 | Forms\Components\Select::make('product_id')
82 | ->label('Product')
83 | ->options(Product::query()->pluck('name', 'id'))
84 | ->required()
85 | ->reactive()
86 | ->afterStateUpdated(fn ($state, Forms\Set $set) =>
87 | $set('unit_price', Product::find($state)?->price ?? 0)),
88 |
89 | Forms\Components\TextInput::make('quantity')
90 | ->numeric()
91 | ->live()
92 | ->dehydrated()
93 | ->default(1)
94 | ->required(),
95 |
96 | Forms\Components\TextInput::make('unit_price')
97 | ->label('Unit Price')
98 | ->disabled()
99 | ->dehydrated()
100 | ->numeric()
101 | ->required(),
102 |
103 | Forms\Components\Placeholder::make('total_price')
104 | ->label('Total Price')
105 | ->content(function ($get) {
106 | return $get('quantity') * $get('unit_price');
107 | })
108 | ])->columns(4)
109 | ])
110 | ])->columnSpanFull()
111 | ]);
112 | }
113 |
114 | public static function table(Table $table): Table
115 | {
116 | return $table
117 | ->columns([
118 | Tables\Columns\TextColumn::make('number')
119 | ->searchable()
120 | ->sortable(),
121 |
122 | Tables\Columns\TextColumn::make('customer.name')
123 | ->searchable()
124 | ->sortable()
125 | ->toggleable(),
126 |
127 | Tables\Columns\TextColumn::make('status')
128 | ->searchable()
129 | ->sortable(),
130 |
131 | Tables\Columns\TextColumn::make('created_at')
132 | ->label('Order Date')
133 | ->date(),
134 | ])
135 | ->filters([
136 | //
137 | ])
138 | ->actions([
139 | Tables\Actions\ActionGroup::make([
140 | Tables\Actions\ViewAction::make(),
141 | Tables\Actions\EditAction::make(),
142 | Tables\Actions\DeleteAction::make()
143 | ])
144 | ])
145 | ->bulkActions([
146 | Tables\Actions\BulkActionGroup::make([
147 | ExportBulkAction::make(),
148 | Tables\Actions\DeleteBulkAction::make(),
149 | ]),
150 | ])
151 | ->emptyStateActions([
152 | Tables\Actions\CreateAction::make(),
153 | ]);
154 | }
155 |
156 | public static function getRelations(): array
157 | {
158 | return [
159 | //
160 | ];
161 | }
162 |
163 | public static function getPages(): array
164 | {
165 | return [
166 | 'index' => Pages\ListOrders::route('/'),
167 | 'create' => Pages\CreateOrder::route('/create'),
168 | 'edit' => Pages\EditOrder::route('/{record}/edit'),
169 | ];
170 | }
171 | }
172 |
--------------------------------------------------------------------------------
/app/Filament/Resources/OrderResource/Pages/CreateOrder.php:
--------------------------------------------------------------------------------
1 | $record->brand->name,
49 | ];
50 | }
51 |
52 | public static function getGlobalSearchEloquentQuery(): Builder
53 | {
54 | return parent::getGlobalSearchEloquentQuery()->with(['brand']);
55 | }
56 |
57 | public static function form(Form $form): Form
58 | {
59 | return $form
60 | ->schema([
61 | Forms\Components\Group::make()
62 | ->schema([
63 | Forms\Components\Section::make()
64 | ->schema([
65 | Forms\Components\TextInput::make('name')
66 | ->required()
67 | ->live(onBlur: true)
68 | ->afterStateUpdated(function(string $operation, $state, Forms\Set $set) {
69 | if ($operation !== 'create') {
70 | return;
71 | }
72 |
73 | $set('slug', Str::slug($state));
74 | }),
75 |
76 | Forms\Components\TextInput::make('slug')
77 | ->disabled()
78 | ->dehydrated()
79 | ->required()
80 | ->unique(Product::class, 'slug', ignoreRecord: true),
81 |
82 | Forms\Components\MarkdownEditor::make('description')
83 | ->columnSpan('full')
84 | ])->columns(2),
85 |
86 | Forms\Components\Section::make('Pricing & Inventory')
87 | ->schema([
88 | Forms\Components\TextInput::make('sku')
89 | ->label("SKU (Stock Keeping Unit)")
90 | ->required(),
91 |
92 | Forms\Components\TextInput::make('price')
93 | ->numeric()
94 | ->rules('regex:/^\d{1,6}(\.\d{0,2})?$/')
95 | ->required(),
96 |
97 | Forms\Components\TextInput::make('quantity')
98 | ->numeric()
99 | ->minValue(0)
100 | ->maxValue(100)
101 | ->required(),
102 |
103 | Forms\Components\Select::make('type')
104 | ->options([
105 | 'downloadable' => ProductTypeEnum::DOWNLOADABLE->value,
106 | 'deliverable' => ProductTypeEnum::DELIVERABLE->value,
107 | ])->required()
108 | ])->columns(2),
109 | ]),
110 |
111 | Forms\Components\Group::make()
112 | ->schema([
113 | Forms\Components\Section::make('Status')
114 | ->schema([
115 | Forms\Components\Toggle::make('is_visible')
116 | ->label('Visibility')
117 | ->helperText('Enable or disable product visibility')
118 | ->default(true),
119 |
120 | Forms\Components\Toggle::make('is_featured')
121 | ->label('Featured')
122 | ->helperText('Enable or disable products featured status'),
123 |
124 | Forms\Components\DatePicker::make('published_at')
125 | ->label('Availability')
126 | ->default(now())
127 | ]),
128 |
129 | Forms\Components\Section::make('Image')
130 | ->schema([
131 | Forms\Components\FileUpload::make('image')
132 | ->directory('form-attachments')
133 | ->preserveFilenames()
134 | ->image()
135 | ->imageEditor()
136 | ])->collapsible(),
137 |
138 | Forms\Components\Section::make('Associations')
139 | ->schema([
140 | Forms\Components\Select::make('brand_id')
141 | ->relationship('brand', 'name')
142 | ->required(),
143 |
144 | Forms\Components\Select::make('categories')
145 | ->relationship('categories', 'name')
146 | ->multiple()
147 | ->required(),
148 | ]),
149 | ]),
150 | ]);
151 | }
152 |
153 | public static function table(Table $table): Table
154 | {
155 | return $table
156 | ->columns([
157 | Tables\Columns\ImageColumn::make('image'),
158 |
159 | Tables\Columns\TextColumn::make('name')
160 | ->searchable()
161 | ->sortable(),
162 |
163 | Tables\Columns\TextColumn::make('brand.name')
164 | ->searchable()
165 | ->sortable()
166 | ->toggleable(),
167 |
168 | Tables\Columns\IconColumn::make('is_visible')
169 | ->sortable()
170 | ->toggleable()
171 | ->label('Visibility')
172 | ->boolean(),
173 |
174 | Tables\Columns\TextColumn::make('price')
175 | ->sortable()
176 | ->toggleable(),
177 |
178 | Tables\Columns\TextColumn::make('quantity')
179 | ->sortable()
180 | ->toggleable(),
181 |
182 | Tables\Columns\TextColumn::make('published_at')
183 | ->date()
184 | ->sortable(),
185 |
186 | Tables\Columns\TextColumn::make('type')
187 | ])
188 | ->filters([
189 | Tables\Filters\TernaryFilter::make('is_visible')
190 | ->label('Visibility')
191 | ->boolean()
192 | ->trueLabel('Only Visible Products')
193 | ->falseLabel('Only Hidden Products')
194 | ->native(false),
195 |
196 | Tables\Filters\SelectFilter::make('brand')
197 | ->relationship('brand', 'name')
198 | ])
199 | ->actions([
200 | Tables\Actions\ActionGroup::make([
201 | Tables\Actions\ViewAction::make(),
202 | Tables\Actions\EditAction::make(),
203 | Tables\Actions\DeleteAction::make()
204 | ])
205 | ])
206 | ->bulkActions([
207 | Tables\Actions\BulkActionGroup::make([
208 | Tables\Actions\DeleteBulkAction::make(),
209 | ]),
210 | ])
211 | ->emptyStateActions([
212 | Tables\Actions\CreateAction::make(),
213 | ]);
214 | }
215 |
216 | public static function getRelations(): array
217 | {
218 | return [
219 | //
220 | ];
221 | }
222 |
223 | public static function getPages(): array
224 | {
225 | return [
226 | 'index' => Pages\ListProducts::route('/'),
227 | 'create' => Pages\CreateProduct::route('/create'),
228 | 'edit' => Pages\EditProduct::route('/{record}/edit'),
229 | ];
230 | }
231 | }
232 |
--------------------------------------------------------------------------------
/app/Filament/Resources/ProductResource/Pages/CreateProduct.php:
--------------------------------------------------------------------------------
1 | query(OrderResource::getEloquentQuery())
20 | ->defaultPaginationPageOption(5)
21 | ->defaultSort('created_at', 'desc')
22 | ->columns([
23 | Tables\Columns\TextColumn::make('number')
24 | ->searchable()
25 | ->sortable(),
26 |
27 | Tables\Columns\TextColumn::make('customer.name')
28 | ->searchable()
29 | ->sortable()
30 | ->toggleable(),
31 |
32 | Tables\Columns\TextColumn::make('status')
33 | ->searchable()
34 | ->sortable(),
35 |
36 | Tables\Columns\TextColumn::make('created_at')
37 | ->label('Order Date')
38 | ->date(),
39 | ]);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app/Filament/Widgets/OrdersChart.php:
--------------------------------------------------------------------------------
1 | groupBy('status')
20 | ->pluck('count', 'status')
21 | ->toArray();
22 |
23 | return [
24 | 'datasets' => [
25 | [
26 | 'label' => 'Orders',
27 | 'data' => array_values($data)
28 | ]
29 | ],
30 | 'labels' => OrderStatusEnum::cases()
31 | ];
32 | }
33 |
34 | protected function getType(): string
35 | {
36 | return 'bar';
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/app/Filament/Widgets/ProductsChart.php:
--------------------------------------------------------------------------------
1 | getProductsPerMonth();
18 |
19 | return [
20 | 'datasets' => [
21 | [
22 | 'label' => 'Blog posts created',
23 | 'data' => $data['productsPerMonth']
24 | ]
25 | ],
26 | 'labels' => $data['months']
27 | ];
28 | }
29 |
30 | protected function getType(): string
31 | {
32 | return 'line';
33 | }
34 |
35 | private function getProductsPerMonth(): array
36 | {
37 | $now = Carbon::now();
38 |
39 | $productsPerMonth = [];
40 | $months = collect(range(1, 12))->map(function ($month) use ($now, &$productsPerMonth) {
41 | $count = Product::whereMonth('created_at', Carbon::parse($now->month($month)->format('Y-m')))->count();
42 | $productsPerMonth[] = $count;
43 |
44 | return $now->month($month)->format('M');
45 | })->toArray();
46 |
47 | return [
48 | 'productsPerMonth' => $productsPerMonth,
49 | 'months' => $months,
50 | ];
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/app/Filament/Widgets/StatsOverview.php:
--------------------------------------------------------------------------------
1 | description('Increase in customers')
23 | ->descriptionIcon('heroicon-m-arrow-trending-up')
24 | ->color('success')
25 | ->chart([7, 3, 4, 5, 6, 3, 5, 3]),
26 | Stat::make('Total Products', Product::count())
27 | ->description('Total products in app')
28 | ->descriptionIcon('heroicon-m-arrow-trending-down')
29 | ->color('danger')
30 | ->chart([7, 3, 4, 5, 6, 3, 5, 3]),
31 | Stat::make('Pending Orders', Order::where('status', OrderStatusEnum::PENDING->value)->count())
32 | ->description('Total products in app')
33 | ->descriptionIcon('heroicon-m-arrow-trending-down')
34 | ->color('danger')
35 | ->chart([7, 3, 4, 5, 6, 3, 5, 3]),
36 | ];
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Controller.php:
--------------------------------------------------------------------------------
1 |
15 | */
16 | protected $middleware = [
17 | // \App\Http\Middleware\TrustHosts::class,
18 | \App\Http\Middleware\TrustProxies::class,
19 | \Illuminate\Http\Middleware\HandleCors::class,
20 | \App\Http\Middleware\PreventRequestsDuringMaintenance::class,
21 | \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
22 | \App\Http\Middleware\TrimStrings::class,
23 | \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
24 | ];
25 |
26 | /**
27 | * The application's route middleware groups.
28 | *
29 | * @var array>
30 | */
31 | protected $middlewareGroups = [
32 | 'web' => [
33 | \App\Http\Middleware\EncryptCookies::class,
34 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
35 | \Illuminate\Session\Middleware\StartSession::class,
36 | \Illuminate\View\Middleware\ShareErrorsFromSession::class,
37 | \App\Http\Middleware\VerifyCsrfToken::class,
38 | \Illuminate\Routing\Middleware\SubstituteBindings::class,
39 | ],
40 |
41 | 'api' => [
42 | // \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
43 | \Illuminate\Routing\Middleware\ThrottleRequests::class.':api',
44 | \Illuminate\Routing\Middleware\SubstituteBindings::class,
45 | ],
46 | ];
47 |
48 | /**
49 | * The application's middleware aliases.
50 | *
51 | * Aliases may be used instead of class names to conveniently assign middleware to routes and groups.
52 | *
53 | * @var array
54 | */
55 | protected $middlewareAliases = [
56 | 'auth' => \App\Http\Middleware\Authenticate::class,
57 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
58 | 'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class,
59 | 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
60 | 'can' => \Illuminate\Auth\Middleware\Authorize::class,
61 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
62 | 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
63 | 'precognitive' => \Illuminate\Foundation\Http\Middleware\HandlePrecognitiveRequests::class,
64 | 'signed' => \App\Http\Middleware\ValidateSignature::class,
65 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
66 | 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
67 | ];
68 | }
69 |
--------------------------------------------------------------------------------
/app/Http/Middleware/Authenticate.php:
--------------------------------------------------------------------------------
1 | expectsJson() ? null : route('login');
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/app/Http/Middleware/EncryptCookies.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | protected $except = [
15 | //
16 | ];
17 | }
18 |
--------------------------------------------------------------------------------
/app/Http/Middleware/PreventRequestsDuringMaintenance.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | protected $except = [
15 | //
16 | ];
17 | }
18 |
--------------------------------------------------------------------------------
/app/Http/Middleware/RedirectIfAuthenticated.php:
--------------------------------------------------------------------------------
1 | check()) {
24 | return redirect(RouteServiceProvider::HOME);
25 | }
26 | }
27 |
28 | return $next($request);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/Http/Middleware/TrimStrings.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | protected $except = [
15 | 'current_password',
16 | 'password',
17 | 'password_confirmation',
18 | ];
19 | }
20 |
--------------------------------------------------------------------------------
/app/Http/Middleware/TrustHosts.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | public function hosts(): array
15 | {
16 | return [
17 | $this->allSubdomainsOfApplicationUrl(),
18 | ];
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/app/Http/Middleware/TrustProxies.php:
--------------------------------------------------------------------------------
1 | |string|null
14 | */
15 | protected $proxies;
16 |
17 | /**
18 | * The headers that should be used to detect proxies.
19 | *
20 | * @var int
21 | */
22 | protected $headers =
23 | Request::HEADER_X_FORWARDED_FOR |
24 | Request::HEADER_X_FORWARDED_HOST |
25 | Request::HEADER_X_FORWARDED_PORT |
26 | Request::HEADER_X_FORWARDED_PROTO |
27 | Request::HEADER_X_FORWARDED_AWS_ELB;
28 | }
29 |
--------------------------------------------------------------------------------
/app/Http/Middleware/ValidateSignature.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | protected $except = [
15 | // 'fbclid',
16 | // 'utm_campaign',
17 | // 'utm_content',
18 | // 'utm_medium',
19 | // 'utm_source',
20 | // 'utm_term',
21 | ];
22 | }
23 |
--------------------------------------------------------------------------------
/app/Http/Middleware/VerifyCsrfToken.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | protected $except = [
15 | //
16 | ];
17 | }
18 |
--------------------------------------------------------------------------------
/app/Models/Brand.php:
--------------------------------------------------------------------------------
1 | hasMany(Product::class);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/app/Models/Category.php:
--------------------------------------------------------------------------------
1 | belongsTo(Category::class, 'parent_id');
22 | }
23 |
24 | public function child(): HasMany
25 | {
26 | return $this->hasMany(Category::class, 'parent_id');
27 | }
28 |
29 | public function products(): BelongsToMany
30 | {
31 | return $this->belongsToMany(Product::class);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/app/Models/Customer.php:
--------------------------------------------------------------------------------
1 | belongsTo(Customer::class);
22 | }
23 |
24 | public function items(): HasMany
25 | {
26 | return $this->hasMany(OrderItem::class);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/app/Models/OrderItem.php:
--------------------------------------------------------------------------------
1 | belongsTo(Brand::class);
21 | }
22 |
23 | public function categories(): BelongsToMany
24 | {
25 | return $this->belongsToMany(Category::class);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/Models/User.php:
--------------------------------------------------------------------------------
1 |
19 | */
20 | protected $fillable = [
21 | 'name',
22 | 'email',
23 | 'password',
24 | ];
25 |
26 | /**
27 | * The attributes that should be hidden for serialization.
28 | *
29 | * @var array
30 | */
31 | protected $hidden = [
32 | 'password',
33 | 'remember_token',
34 | ];
35 |
36 | /**
37 | * The attributes that should be cast.
38 | *
39 | * @var array
40 | */
41 | protected $casts = [
42 | 'email_verified_at' => 'datetime',
43 | 'password' => 'hashed',
44 | ];
45 | }
46 |
--------------------------------------------------------------------------------
/app/Providers/AppServiceProvider.php:
--------------------------------------------------------------------------------
1 |
14 | */
15 | protected $policies = [
16 | //
17 | ];
18 |
19 | /**
20 | * Register any authentication / authorization services.
21 | */
22 | public function boot(): void
23 | {
24 | //
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/Providers/BroadcastServiceProvider.php:
--------------------------------------------------------------------------------
1 | >
16 | */
17 | protected $listen = [
18 | Registered::class => [
19 | SendEmailVerificationNotification::class,
20 | ],
21 | ];
22 |
23 | /**
24 | * Register any events for your application.
25 | */
26 | public function boot(): void
27 | {
28 | //
29 | }
30 |
31 | /**
32 | * Determine if events and listeners should be automatically discovered.
33 | */
34 | public function shouldDiscoverEvents(): bool
35 | {
36 | return false;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/app/Providers/Filament/AdminPanelProvider.php:
--------------------------------------------------------------------------------
1 | default()
30 | ->id('dashboard')
31 | ->path('dashboard')
32 | ->login()
33 | ->colors([
34 | 'primary' => 'rgb(103, 76, 196)',
35 | ])
36 | ->globalSearchKeyBindings(['command+k', 'ctrl+k'])
37 | ->navigationItems([
38 | NavigationItem::make('Blog')
39 | ->url('https://blog.codewithdary.com', shouldOpenInNewTab: true)
40 | ->icon('heroicon-o-pencil-square')
41 | ->group('External')
42 | ->sort(2)
43 | ])
44 | ->userMenuItems([
45 | MenuItem::make()
46 | ->label('Settings')
47 | ->url('')
48 | ->icon('heroicon-o-cog-6-tooth'),
49 | 'logout' => MenuItem::make()->label('Log Out')
50 | ])
51 | ->plugins([
52 | SpotlightPlugin::make()
53 | ])
54 | ->font('Poppins')
55 | ->favicon('images/favicon.png')
56 | ->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources')
57 | ->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages')
58 | ->pages([
59 | Pages\Dashboard::class,
60 | ])
61 | ->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets')
62 | ->widgets([
63 | Widgets\AccountWidget::class,
64 | Widgets\FilamentInfoWidget::class,
65 | ])
66 | ->middleware([
67 | EncryptCookies::class,
68 | AddQueuedCookiesToResponse::class,
69 | StartSession::class,
70 | AuthenticateSession::class,
71 | ShareErrorsFromSession::class,
72 | VerifyCsrfToken::class,
73 | SubstituteBindings::class,
74 | DisableBladeIconComponents::class,
75 | DispatchServingFilamentEvent::class,
76 | ])
77 | ->authMiddleware([
78 | Authenticate::class,
79 | ]);
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/app/Providers/RouteServiceProvider.php:
--------------------------------------------------------------------------------
1 | by($request->user()?->id ?: $request->ip());
29 | });
30 |
31 | $this->routes(function () {
32 | Route::middleware('api')
33 | ->prefix('api')
34 | ->group(base_path('routes/api.php'));
35 |
36 | Route::middleware('web')
37 | ->group(base_path('routes/web.php'));
38 | });
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/artisan:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env php
2 | make(Illuminate\Contracts\Console\Kernel::class);
34 |
35 | $status = $kernel->handle(
36 | $input = new Symfony\Component\Console\Input\ArgvInput,
37 | new Symfony\Component\Console\Output\ConsoleOutput
38 | );
39 |
40 | /*
41 | |--------------------------------------------------------------------------
42 | | Shutdown The Application
43 | |--------------------------------------------------------------------------
44 | |
45 | | Once Artisan has finished running, we will fire off the shutdown events
46 | | so that any final work may be done by the application before we shut
47 | | down the process. This is the last thing to happen to the request.
48 | |
49 | */
50 |
51 | $kernel->terminate($input, $status);
52 |
53 | exit($status);
54 |
--------------------------------------------------------------------------------
/bootstrap/app.php:
--------------------------------------------------------------------------------
1 | singleton(
30 | Illuminate\Contracts\Http\Kernel::class,
31 | App\Http\Kernel::class
32 | );
33 |
34 | $app->singleton(
35 | Illuminate\Contracts\Console\Kernel::class,
36 | App\Console\Kernel::class
37 | );
38 |
39 | $app->singleton(
40 | Illuminate\Contracts\Debug\ExceptionHandler::class,
41 | App\Exceptions\Handler::class
42 | );
43 |
44 | /*
45 | |--------------------------------------------------------------------------
46 | | Return The Application
47 | |--------------------------------------------------------------------------
48 | |
49 | | This script returns the application instance. The instance is given to
50 | | the calling script so we can separate the building of the instances
51 | | from the actual running of the application and sending responses.
52 | |
53 | */
54 |
55 | return $app;
56 |
--------------------------------------------------------------------------------
/bootstrap/cache/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "laravel/laravel",
3 | "type": "project",
4 | "description": "The skeleton application for the Laravel framework.",
5 | "keywords": [
6 | "laravel",
7 | "framework"
8 | ],
9 | "license": "MIT",
10 | "require": {
11 | "php": "^8.1",
12 | "filament/filament": "^3.0-stable",
13 | "guzzlehttp/guzzle": "^7.2",
14 | "laravel/framework": "^10.10",
15 | "laravel/sanctum": "^3.2",
16 | "laravel/tinker": "^2.8",
17 | "livewire/livewire": "^3.0@beta",
18 | "pxlrbt/filament-excel": "^2.1",
19 | "pxlrbt/filament-spotlight": "^1.0"
20 | },
21 | "require-dev": {
22 | "fakerphp/faker": "^1.9.1",
23 | "laravel/pint": "^1.0",
24 | "laravel/sail": "^1.18",
25 | "mockery/mockery": "^1.4.4",
26 | "nunomaduro/collision": "^7.0",
27 | "phpunit/phpunit": "^10.1",
28 | "spatie/laravel-ignition": "^2.0"
29 | },
30 | "autoload": {
31 | "psr-4": {
32 | "App\\": "app/",
33 | "Database\\Factories\\": "database/factories/",
34 | "Database\\Seeders\\": "database/seeders/"
35 | }
36 | },
37 | "autoload-dev": {
38 | "psr-4": {
39 | "Tests\\": "tests/"
40 | }
41 | },
42 | "scripts": {
43 | "post-autoload-dump": [
44 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
45 | "@php artisan package:discover --ansi",
46 | "@php artisan filament:upgrade"
47 | ],
48 | "post-update-cmd": [
49 | "@php artisan vendor:publish --tag=laravel-assets --ansi --force"
50 | ],
51 | "post-root-package-install": [
52 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
53 | ],
54 | "post-create-project-cmd": [
55 | "@php artisan key:generate --ansi"
56 | ]
57 | },
58 | "extra": {
59 | "laravel": {
60 | "dont-discover": []
61 | }
62 | },
63 | "config": {
64 | "optimize-autoloader": true,
65 | "preferred-install": "dist",
66 | "sort-packages": true,
67 | "allow-plugins": {
68 | "pestphp/pest-plugin": true,
69 | "php-http/discovery": true
70 | }
71 | },
72 | "minimum-stability": "stable",
73 | "prefer-stable": true
74 | }
75 |
--------------------------------------------------------------------------------
/config/app.php:
--------------------------------------------------------------------------------
1 | env('APP_NAME', 'Laravel'),
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | Application Environment
24 | |--------------------------------------------------------------------------
25 | |
26 | | This value determines the "environment" your application is currently
27 | | running in. This may determine how you prefer to configure various
28 | | services the application utilizes. Set this in your ".env" file.
29 | |
30 | */
31 |
32 | 'env' => env('APP_ENV', 'production'),
33 |
34 | /*
35 | |--------------------------------------------------------------------------
36 | | Application Debug Mode
37 | |--------------------------------------------------------------------------
38 | |
39 | | When your application is in debug mode, detailed error messages with
40 | | stack traces will be shown on every error that occurs within your
41 | | application. If disabled, a simple generic error page is shown.
42 | |
43 | */
44 |
45 | 'debug' => (bool) env('APP_DEBUG', false),
46 |
47 | /*
48 | |--------------------------------------------------------------------------
49 | | Application URL
50 | |--------------------------------------------------------------------------
51 | |
52 | | This URL is used by the console to properly generate URLs when using
53 | | the Artisan command line tool. You should set this to the root of
54 | | your application so that it is used when running Artisan tasks.
55 | |
56 | */
57 |
58 | 'url' => env('APP_URL', 'http://localhost'),
59 |
60 | 'asset_url' => env('ASSET_URL'),
61 |
62 | /*
63 | |--------------------------------------------------------------------------
64 | | Application Timezone
65 | |--------------------------------------------------------------------------
66 | |
67 | | Here you may specify the default timezone for your application, which
68 | | will be used by the PHP date and date-time functions. We have gone
69 | | ahead and set this to a sensible default for you out of the box.
70 | |
71 | */
72 |
73 | 'timezone' => 'UTC',
74 |
75 | /*
76 | |--------------------------------------------------------------------------
77 | | Application Locale Configuration
78 | |--------------------------------------------------------------------------
79 | |
80 | | The application locale determines the default locale that will be used
81 | | by the translation service provider. You are free to set this value
82 | | to any of the locales which will be supported by the application.
83 | |
84 | */
85 |
86 | 'locale' => 'en',
87 |
88 | /*
89 | |--------------------------------------------------------------------------
90 | | Application Fallback Locale
91 | |--------------------------------------------------------------------------
92 | |
93 | | The fallback locale determines the locale to use when the current one
94 | | is not available. You may change the value to correspond to any of
95 | | the language folders that are provided through your application.
96 | |
97 | */
98 |
99 | 'fallback_locale' => 'en',
100 |
101 | /*
102 | |--------------------------------------------------------------------------
103 | | Faker Locale
104 | |--------------------------------------------------------------------------
105 | |
106 | | This locale will be used by the Faker PHP library when generating fake
107 | | data for your database seeds. For example, this will be used to get
108 | | localized telephone numbers, street address information and more.
109 | |
110 | */
111 |
112 | 'faker_locale' => 'en_US',
113 |
114 | /*
115 | |--------------------------------------------------------------------------
116 | | Encryption Key
117 | |--------------------------------------------------------------------------
118 | |
119 | | This key is used by the Illuminate encrypter service and should be set
120 | | to a random, 32 character string, otherwise these encrypted strings
121 | | will not be safe. Please do this before deploying an application!
122 | |
123 | */
124 |
125 | 'key' => env('APP_KEY'),
126 |
127 | 'cipher' => 'AES-256-CBC',
128 |
129 | /*
130 | |--------------------------------------------------------------------------
131 | | Maintenance Mode Driver
132 | |--------------------------------------------------------------------------
133 | |
134 | | These configuration options determine the driver used to determine and
135 | | manage Laravel's "maintenance mode" status. The "cache" driver will
136 | | allow maintenance mode to be controlled across multiple machines.
137 | |
138 | | Supported drivers: "file", "cache"
139 | |
140 | */
141 |
142 | 'maintenance' => [
143 | 'driver' => 'file',
144 | // 'store' => 'redis',
145 | ],
146 |
147 | /*
148 | |--------------------------------------------------------------------------
149 | | Autoloaded Service Providers
150 | |--------------------------------------------------------------------------
151 | |
152 | | The service providers listed here will be automatically loaded on the
153 | | request to your application. Feel free to add your own services to
154 | | this array to grant expanded functionality to your applications.
155 | |
156 | */
157 |
158 | 'providers' => ServiceProvider::defaultProviders()->merge([
159 | /*
160 | * Package Service Providers...
161 | */
162 |
163 | /*
164 | * Application Service Providers...
165 | */
166 | App\Providers\AppServiceProvider::class,
167 | App\Providers\AuthServiceProvider::class,
168 | // App\Providers\BroadcastServiceProvider::class,
169 | App\Providers\EventServiceProvider::class,
170 | App\Providers\Filament\AdminPanelProvider::class,
171 | App\Providers\RouteServiceProvider::class,
172 | ])->toArray(),
173 |
174 | /*
175 | |--------------------------------------------------------------------------
176 | | Class Aliases
177 | |--------------------------------------------------------------------------
178 | |
179 | | This array of class aliases will be registered when this application
180 | | is started. However, feel free to register as many as you wish as
181 | | the aliases are "lazy" loaded so they don't hinder performance.
182 | |
183 | */
184 |
185 | 'aliases' => Facade::defaultAliases()->merge([
186 | // 'Example' => App\Facades\Example::class,
187 | ])->toArray(),
188 |
189 | ];
190 |
--------------------------------------------------------------------------------
/config/auth.php:
--------------------------------------------------------------------------------
1 | [
17 | 'guard' => 'web',
18 | 'passwords' => 'users',
19 | ],
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | Authentication Guards
24 | |--------------------------------------------------------------------------
25 | |
26 | | Next, you may define every authentication guard for your application.
27 | | Of course, a great default configuration has been defined for you
28 | | here which uses session storage and the Eloquent user provider.
29 | |
30 | | All authentication drivers have a user provider. This defines how the
31 | | users are actually retrieved out of your database or other storage
32 | | mechanisms used by this application to persist your user's data.
33 | |
34 | | Supported: "session"
35 | |
36 | */
37 |
38 | 'guards' => [
39 | 'web' => [
40 | 'driver' => 'session',
41 | 'provider' => 'users',
42 | ],
43 | ],
44 |
45 | /*
46 | |--------------------------------------------------------------------------
47 | | User Providers
48 | |--------------------------------------------------------------------------
49 | |
50 | | All authentication drivers have a user provider. This defines how the
51 | | users are actually retrieved out of your database or other storage
52 | | mechanisms used by this application to persist your user's data.
53 | |
54 | | If you have multiple user tables or models you may configure multiple
55 | | sources which represent each model / table. These sources may then
56 | | be assigned to any extra authentication guards you have defined.
57 | |
58 | | Supported: "database", "eloquent"
59 | |
60 | */
61 |
62 | 'providers' => [
63 | 'users' => [
64 | 'driver' => 'eloquent',
65 | 'model' => App\Models\User::class,
66 | ],
67 |
68 | // 'users' => [
69 | // 'driver' => 'database',
70 | // 'table' => 'users',
71 | // ],
72 | ],
73 |
74 | /*
75 | |--------------------------------------------------------------------------
76 | | Resetting Passwords
77 | |--------------------------------------------------------------------------
78 | |
79 | | You may specify multiple password reset configurations if you have more
80 | | than one user table or model in the application and you want to have
81 | | separate password reset settings based on the specific user types.
82 | |
83 | | The expiry time is the number of minutes that each reset token will be
84 | | considered valid. This security feature keeps tokens short-lived so
85 | | they have less time to be guessed. You may change this as needed.
86 | |
87 | | The throttle setting is the number of seconds a user must wait before
88 | | generating more password reset tokens. This prevents the user from
89 | | quickly generating a very large amount of password reset tokens.
90 | |
91 | */
92 |
93 | 'passwords' => [
94 | 'users' => [
95 | 'provider' => 'users',
96 | 'table' => 'password_reset_tokens',
97 | 'expire' => 60,
98 | 'throttle' => 60,
99 | ],
100 | ],
101 |
102 | /*
103 | |--------------------------------------------------------------------------
104 | | Password Confirmation Timeout
105 | |--------------------------------------------------------------------------
106 | |
107 | | Here you may define the amount of seconds before a password confirmation
108 | | times out and the user is prompted to re-enter their password via the
109 | | confirmation screen. By default, the timeout lasts for three hours.
110 | |
111 | */
112 |
113 | 'password_timeout' => 10800,
114 |
115 | ];
116 |
--------------------------------------------------------------------------------
/config/broadcasting.php:
--------------------------------------------------------------------------------
1 | env('BROADCAST_DRIVER', 'null'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Broadcast Connections
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may define all of the broadcast connections that will be used
26 | | to broadcast events to other systems or over websockets. Samples of
27 | | each available type of connection are provided inside this array.
28 | |
29 | */
30 |
31 | 'connections' => [
32 |
33 | 'pusher' => [
34 | 'driver' => 'pusher',
35 | 'key' => env('PUSHER_APP_KEY'),
36 | 'secret' => env('PUSHER_APP_SECRET'),
37 | 'app_id' => env('PUSHER_APP_ID'),
38 | 'options' => [
39 | 'cluster' => env('PUSHER_APP_CLUSTER'),
40 | 'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com',
41 | 'port' => env('PUSHER_PORT', 443),
42 | 'scheme' => env('PUSHER_SCHEME', 'https'),
43 | 'encrypted' => true,
44 | 'useTLS' => env('PUSHER_SCHEME', 'https') === 'https',
45 | ],
46 | 'client_options' => [
47 | // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
48 | ],
49 | ],
50 |
51 | 'ably' => [
52 | 'driver' => 'ably',
53 | 'key' => env('ABLY_KEY'),
54 | ],
55 |
56 | 'redis' => [
57 | 'driver' => 'redis',
58 | 'connection' => 'default',
59 | ],
60 |
61 | 'log' => [
62 | 'driver' => 'log',
63 | ],
64 |
65 | 'null' => [
66 | 'driver' => 'null',
67 | ],
68 |
69 | ],
70 |
71 | ];
72 |
--------------------------------------------------------------------------------
/config/cache.php:
--------------------------------------------------------------------------------
1 | env('CACHE_DRIVER', 'file'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Cache Stores
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may define all of the cache "stores" for your application as
26 | | well as their drivers. You may even define multiple stores for the
27 | | same cache driver to group types of items stored in your caches.
28 | |
29 | | Supported drivers: "apc", "array", "database", "file",
30 | | "memcached", "redis", "dynamodb", "octane", "null"
31 | |
32 | */
33 |
34 | 'stores' => [
35 |
36 | 'apc' => [
37 | 'driver' => 'apc',
38 | ],
39 |
40 | 'array' => [
41 | 'driver' => 'array',
42 | 'serialize' => false,
43 | ],
44 |
45 | 'database' => [
46 | 'driver' => 'database',
47 | 'table' => 'cache',
48 | 'connection' => null,
49 | 'lock_connection' => null,
50 | ],
51 |
52 | 'file' => [
53 | 'driver' => 'file',
54 | 'path' => storage_path('framework/cache/data'),
55 | 'lock_path' => storage_path('framework/cache/data'),
56 | ],
57 |
58 | 'memcached' => [
59 | 'driver' => 'memcached',
60 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
61 | 'sasl' => [
62 | env('MEMCACHED_USERNAME'),
63 | env('MEMCACHED_PASSWORD'),
64 | ],
65 | 'options' => [
66 | // Memcached::OPT_CONNECT_TIMEOUT => 2000,
67 | ],
68 | 'servers' => [
69 | [
70 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'),
71 | 'port' => env('MEMCACHED_PORT', 11211),
72 | 'weight' => 100,
73 | ],
74 | ],
75 | ],
76 |
77 | 'redis' => [
78 | 'driver' => 'redis',
79 | 'connection' => 'cache',
80 | 'lock_connection' => 'default',
81 | ],
82 |
83 | 'dynamodb' => [
84 | 'driver' => 'dynamodb',
85 | 'key' => env('AWS_ACCESS_KEY_ID'),
86 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
87 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
88 | 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
89 | 'endpoint' => env('DYNAMODB_ENDPOINT'),
90 | ],
91 |
92 | 'octane' => [
93 | 'driver' => 'octane',
94 | ],
95 |
96 | ],
97 |
98 | /*
99 | |--------------------------------------------------------------------------
100 | | Cache Key Prefix
101 | |--------------------------------------------------------------------------
102 | |
103 | | When utilizing the APC, database, memcached, Redis, or DynamoDB cache
104 | | stores there might be other applications using the same cache. For
105 | | that reason, you may prefix every cache key to avoid collisions.
106 | |
107 | */
108 |
109 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'),
110 |
111 | ];
112 |
--------------------------------------------------------------------------------
/config/cors.php:
--------------------------------------------------------------------------------
1 | ['api/*', 'sanctum/csrf-cookie'],
19 |
20 | 'allowed_methods' => ['*'],
21 |
22 | 'allowed_origins' => ['*'],
23 |
24 | 'allowed_origins_patterns' => [],
25 |
26 | 'allowed_headers' => ['*'],
27 |
28 | 'exposed_headers' => [],
29 |
30 | 'max_age' => 0,
31 |
32 | 'supports_credentials' => false,
33 |
34 | ];
35 |
--------------------------------------------------------------------------------
/config/database.php:
--------------------------------------------------------------------------------
1 | env('DB_CONNECTION', 'mysql'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Database Connections
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here are each of the database connections setup for your application.
26 | | Of course, examples of configuring each database platform that is
27 | | supported by Laravel is shown below to make development simple.
28 | |
29 | |
30 | | All database work in Laravel is done through the PHP PDO facilities
31 | | so make sure you have the driver for your particular database of
32 | | choice installed on your machine before you begin development.
33 | |
34 | */
35 |
36 | 'connections' => [
37 |
38 | 'sqlite' => [
39 | 'driver' => 'sqlite',
40 | 'url' => env('DATABASE_URL'),
41 | 'database' => env('DB_DATABASE', database_path('database.sqlite')),
42 | 'prefix' => '',
43 | 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
44 | ],
45 |
46 | 'mysql' => [
47 | 'driver' => 'mysql',
48 | 'url' => env('DATABASE_URL'),
49 | 'host' => env('DB_HOST', '127.0.0.1'),
50 | 'port' => env('DB_PORT', '3306'),
51 | 'database' => env('DB_DATABASE', 'forge'),
52 | 'username' => env('DB_USERNAME', 'forge'),
53 | 'password' => env('DB_PASSWORD', ''),
54 | 'unix_socket' => env('DB_SOCKET', ''),
55 | 'charset' => 'utf8mb4',
56 | 'collation' => 'utf8mb4_unicode_ci',
57 | 'prefix' => '',
58 | 'prefix_indexes' => true,
59 | 'strict' => true,
60 | 'engine' => null,
61 | 'options' => extension_loaded('pdo_mysql') ? array_filter([
62 | PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
63 | ]) : [],
64 | ],
65 |
66 | 'pgsql' => [
67 | 'driver' => 'pgsql',
68 | 'url' => env('DATABASE_URL'),
69 | 'host' => env('DB_HOST', '127.0.0.1'),
70 | 'port' => env('DB_PORT', '5432'),
71 | 'database' => env('DB_DATABASE', 'forge'),
72 | 'username' => env('DB_USERNAME', 'forge'),
73 | 'password' => env('DB_PASSWORD', ''),
74 | 'charset' => 'utf8',
75 | 'prefix' => '',
76 | 'prefix_indexes' => true,
77 | 'search_path' => 'public',
78 | 'sslmode' => 'prefer',
79 | ],
80 |
81 | 'sqlsrv' => [
82 | 'driver' => 'sqlsrv',
83 | 'url' => env('DATABASE_URL'),
84 | 'host' => env('DB_HOST', 'localhost'),
85 | 'port' => env('DB_PORT', '1433'),
86 | 'database' => env('DB_DATABASE', 'forge'),
87 | 'username' => env('DB_USERNAME', 'forge'),
88 | 'password' => env('DB_PASSWORD', ''),
89 | 'charset' => 'utf8',
90 | 'prefix' => '',
91 | 'prefix_indexes' => true,
92 | // 'encrypt' => env('DB_ENCRYPT', 'yes'),
93 | // 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'),
94 | ],
95 |
96 | ],
97 |
98 | /*
99 | |--------------------------------------------------------------------------
100 | | Migration Repository Table
101 | |--------------------------------------------------------------------------
102 | |
103 | | This table keeps track of all the migrations that have already run for
104 | | your application. Using this information, we can determine which of
105 | | the migrations on disk haven't actually been run in the database.
106 | |
107 | */
108 |
109 | 'migrations' => 'migrations',
110 |
111 | /*
112 | |--------------------------------------------------------------------------
113 | | Redis Databases
114 | |--------------------------------------------------------------------------
115 | |
116 | | Redis is an open source, fast, and advanced key-value store that also
117 | | provides a richer body of commands than a typical key-value system
118 | | such as APC or Memcached. Laravel makes it easy to dig right in.
119 | |
120 | */
121 |
122 | 'redis' => [
123 |
124 | 'client' => env('REDIS_CLIENT', 'phpredis'),
125 |
126 | 'options' => [
127 | 'cluster' => env('REDIS_CLUSTER', 'redis'),
128 | 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
129 | ],
130 |
131 | 'default' => [
132 | 'url' => env('REDIS_URL'),
133 | 'host' => env('REDIS_HOST', '127.0.0.1'),
134 | 'username' => env('REDIS_USERNAME'),
135 | 'password' => env('REDIS_PASSWORD'),
136 | 'port' => env('REDIS_PORT', '6379'),
137 | 'database' => env('REDIS_DB', '0'),
138 | ],
139 |
140 | 'cache' => [
141 | 'url' => env('REDIS_URL'),
142 | 'host' => env('REDIS_HOST', '127.0.0.1'),
143 | 'username' => env('REDIS_USERNAME'),
144 | 'password' => env('REDIS_PASSWORD'),
145 | 'port' => env('REDIS_PORT', '6379'),
146 | 'database' => env('REDIS_CACHE_DB', '1'),
147 | ],
148 |
149 | ],
150 |
151 | ];
152 |
--------------------------------------------------------------------------------
/config/filament.php:
--------------------------------------------------------------------------------
1 | [
18 |
19 | // 'echo' => [
20 | // 'broadcaster' => 'pusher',
21 | // 'key' => env('VITE_PUSHER_APP_KEY'),
22 | // 'cluster' => env('VITE_PUSHER_APP_CLUSTER'),
23 | // 'forceTLS' => true,
24 | // ],
25 |
26 | ],
27 |
28 | /*
29 | |--------------------------------------------------------------------------
30 | | Default Filesystem Disk
31 | |--------------------------------------------------------------------------
32 | |
33 | | This is the storage disk Filament will use to put media. You may use any
34 | | of the disks defined in the `config/filesystems.php`.
35 | |
36 | */
37 |
38 | 'default_filesystem_disk' => env('FILAMENT_FILESYSTEM_DISK', 'public'),
39 |
40 | ];
41 |
--------------------------------------------------------------------------------
/config/filesystems.php:
--------------------------------------------------------------------------------
1 | env('FILESYSTEM_DISK', 'local'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Filesystem Disks
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here you may configure as many filesystem "disks" as you wish, and you
24 | | may even configure multiple disks of the same driver. Defaults have
25 | | been set up for each driver as an example of the required values.
26 | |
27 | | Supported Drivers: "local", "ftp", "sftp", "s3"
28 | |
29 | */
30 |
31 | 'disks' => [
32 |
33 | 'local' => [
34 | 'driver' => 'local',
35 | 'root' => storage_path('app'),
36 | 'throw' => false,
37 | ],
38 |
39 | 'public' => [
40 | 'driver' => 'local',
41 | 'root' => storage_path('app/public'),
42 | 'url' => env('APP_URL').'/storage',
43 | 'visibility' => 'public',
44 | 'throw' => false,
45 | ],
46 |
47 | 's3' => [
48 | 'driver' => 's3',
49 | 'key' => env('AWS_ACCESS_KEY_ID'),
50 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
51 | 'region' => env('AWS_DEFAULT_REGION'),
52 | 'bucket' => env('AWS_BUCKET'),
53 | 'url' => env('AWS_URL'),
54 | 'endpoint' => env('AWS_ENDPOINT'),
55 | 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
56 | 'throw' => false,
57 | ],
58 |
59 | ],
60 |
61 | /*
62 | |--------------------------------------------------------------------------
63 | | Symbolic Links
64 | |--------------------------------------------------------------------------
65 | |
66 | | Here you may configure the symbolic links that will be created when the
67 | | `storage:link` Artisan command is executed. The array keys should be
68 | | the locations of the links and the values should be their targets.
69 | |
70 | */
71 |
72 | 'links' => [
73 | public_path('storage') => storage_path('app/public'),
74 | ],
75 |
76 | ];
77 |
--------------------------------------------------------------------------------
/config/hashing.php:
--------------------------------------------------------------------------------
1 | 'bcrypt',
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Bcrypt Options
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may specify the configuration options that should be used when
26 | | passwords are hashed using the Bcrypt algorithm. This will allow you
27 | | to control the amount of time it takes to hash the given password.
28 | |
29 | */
30 |
31 | 'bcrypt' => [
32 | 'rounds' => env('BCRYPT_ROUNDS', 10),
33 | ],
34 |
35 | /*
36 | |--------------------------------------------------------------------------
37 | | Argon Options
38 | |--------------------------------------------------------------------------
39 | |
40 | | Here you may specify the configuration options that should be used when
41 | | passwords are hashed using the Argon algorithm. These will allow you
42 | | to control the amount of time it takes to hash the given password.
43 | |
44 | */
45 |
46 | 'argon' => [
47 | 'memory' => 65536,
48 | 'threads' => 1,
49 | 'time' => 4,
50 | ],
51 |
52 | ];
53 |
--------------------------------------------------------------------------------
/config/logging.php:
--------------------------------------------------------------------------------
1 | env('LOG_CHANNEL', 'stack'),
22 |
23 | /*
24 | |--------------------------------------------------------------------------
25 | | Deprecations Log Channel
26 | |--------------------------------------------------------------------------
27 | |
28 | | This option controls the log channel that should be used to log warnings
29 | | regarding deprecated PHP and library features. This allows you to get
30 | | your application ready for upcoming major versions of dependencies.
31 | |
32 | */
33 |
34 | 'deprecations' => [
35 | 'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
36 | 'trace' => false,
37 | ],
38 |
39 | /*
40 | |--------------------------------------------------------------------------
41 | | Log Channels
42 | |--------------------------------------------------------------------------
43 | |
44 | | Here you may configure the log channels for your application. Out of
45 | | the box, Laravel uses the Monolog PHP logging library. This gives
46 | | you a variety of powerful log handlers / formatters to utilize.
47 | |
48 | | Available Drivers: "single", "daily", "slack", "syslog",
49 | | "errorlog", "monolog",
50 | | "custom", "stack"
51 | |
52 | */
53 |
54 | 'channels' => [
55 | 'stack' => [
56 | 'driver' => 'stack',
57 | 'channels' => ['single'],
58 | 'ignore_exceptions' => false,
59 | ],
60 |
61 | 'single' => [
62 | 'driver' => 'single',
63 | 'path' => storage_path('logs/laravel.log'),
64 | 'level' => env('LOG_LEVEL', 'debug'),
65 | 'replace_placeholders' => true,
66 | ],
67 |
68 | 'daily' => [
69 | 'driver' => 'daily',
70 | 'path' => storage_path('logs/laravel.log'),
71 | 'level' => env('LOG_LEVEL', 'debug'),
72 | 'days' => 14,
73 | 'replace_placeholders' => true,
74 | ],
75 |
76 | 'slack' => [
77 | 'driver' => 'slack',
78 | 'url' => env('LOG_SLACK_WEBHOOK_URL'),
79 | 'username' => 'Laravel Log',
80 | 'emoji' => ':boom:',
81 | 'level' => env('LOG_LEVEL', 'critical'),
82 | 'replace_placeholders' => true,
83 | ],
84 |
85 | 'papertrail' => [
86 | 'driver' => 'monolog',
87 | 'level' => env('LOG_LEVEL', 'debug'),
88 | 'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
89 | 'handler_with' => [
90 | 'host' => env('PAPERTRAIL_URL'),
91 | 'port' => env('PAPERTRAIL_PORT'),
92 | 'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
93 | ],
94 | 'processors' => [PsrLogMessageProcessor::class],
95 | ],
96 |
97 | 'stderr' => [
98 | 'driver' => 'monolog',
99 | 'level' => env('LOG_LEVEL', 'debug'),
100 | 'handler' => StreamHandler::class,
101 | 'formatter' => env('LOG_STDERR_FORMATTER'),
102 | 'with' => [
103 | 'stream' => 'php://stderr',
104 | ],
105 | 'processors' => [PsrLogMessageProcessor::class],
106 | ],
107 |
108 | 'syslog' => [
109 | 'driver' => 'syslog',
110 | 'level' => env('LOG_LEVEL', 'debug'),
111 | 'facility' => LOG_USER,
112 | 'replace_placeholders' => true,
113 | ],
114 |
115 | 'errorlog' => [
116 | 'driver' => 'errorlog',
117 | 'level' => env('LOG_LEVEL', 'debug'),
118 | 'replace_placeholders' => true,
119 | ],
120 |
121 | 'null' => [
122 | 'driver' => 'monolog',
123 | 'handler' => NullHandler::class,
124 | ],
125 |
126 | 'emergency' => [
127 | 'path' => storage_path('logs/laravel.log'),
128 | ],
129 | ],
130 |
131 | ];
132 |
--------------------------------------------------------------------------------
/config/mail.php:
--------------------------------------------------------------------------------
1 | env('MAIL_MAILER', 'smtp'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Mailer Configurations
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here you may configure all of the mailers used by your application plus
24 | | their respective settings. Several examples have been configured for
25 | | you and you are free to add your own as your application requires.
26 | |
27 | | Laravel supports a variety of mail "transport" drivers to be used while
28 | | sending an e-mail. You will specify which one you are using for your
29 | | mailers below. You are free to add additional mailers as required.
30 | |
31 | | Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2",
32 | | "postmark", "log", "array", "failover"
33 | |
34 | */
35 |
36 | 'mailers' => [
37 | 'smtp' => [
38 | 'transport' => 'smtp',
39 | 'url' => env('MAIL_URL'),
40 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
41 | 'port' => env('MAIL_PORT', 587),
42 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'),
43 | 'username' => env('MAIL_USERNAME'),
44 | 'password' => env('MAIL_PASSWORD'),
45 | 'timeout' => null,
46 | 'local_domain' => env('MAIL_EHLO_DOMAIN'),
47 | ],
48 |
49 | 'ses' => [
50 | 'transport' => 'ses',
51 | ],
52 |
53 | 'mailgun' => [
54 | 'transport' => 'mailgun',
55 | // 'client' => [
56 | // 'timeout' => 5,
57 | // ],
58 | ],
59 |
60 | 'postmark' => [
61 | 'transport' => 'postmark',
62 | // 'client' => [
63 | // 'timeout' => 5,
64 | // ],
65 | ],
66 |
67 | 'sendmail' => [
68 | 'transport' => 'sendmail',
69 | 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'),
70 | ],
71 |
72 | 'log' => [
73 | 'transport' => 'log',
74 | 'channel' => env('MAIL_LOG_CHANNEL'),
75 | ],
76 |
77 | 'array' => [
78 | 'transport' => 'array',
79 | ],
80 |
81 | 'failover' => [
82 | 'transport' => 'failover',
83 | 'mailers' => [
84 | 'smtp',
85 | 'log',
86 | ],
87 | ],
88 | ],
89 |
90 | /*
91 | |--------------------------------------------------------------------------
92 | | Global "From" Address
93 | |--------------------------------------------------------------------------
94 | |
95 | | You may wish for all e-mails sent by your application to be sent from
96 | | the same address. Here, you may specify a name and address that is
97 | | used globally for all e-mails that are sent by your application.
98 | |
99 | */
100 |
101 | 'from' => [
102 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
103 | 'name' => env('MAIL_FROM_NAME', 'Example'),
104 | ],
105 |
106 | /*
107 | |--------------------------------------------------------------------------
108 | | Markdown Mail Settings
109 | |--------------------------------------------------------------------------
110 | |
111 | | If you are using Markdown based email rendering, you may configure your
112 | | theme and component paths here, allowing you to customize the design
113 | | of the emails. Or, you may simply stick with the Laravel defaults!
114 | |
115 | */
116 |
117 | 'markdown' => [
118 | 'theme' => 'default',
119 |
120 | 'paths' => [
121 | resource_path('views/vendor/mail'),
122 | ],
123 | ],
124 |
125 | ];
126 |
--------------------------------------------------------------------------------
/config/queue.php:
--------------------------------------------------------------------------------
1 | env('QUEUE_CONNECTION', 'sync'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Queue Connections
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here you may configure the connection information for each server that
24 | | is used by your application. A default configuration has been added
25 | | for each back-end shipped with Laravel. You are free to add more.
26 | |
27 | | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
28 | |
29 | */
30 |
31 | 'connections' => [
32 |
33 | 'sync' => [
34 | 'driver' => 'sync',
35 | ],
36 |
37 | 'database' => [
38 | 'driver' => 'database',
39 | 'table' => 'jobs',
40 | 'queue' => 'default',
41 | 'retry_after' => 90,
42 | 'after_commit' => false,
43 | ],
44 |
45 | 'beanstalkd' => [
46 | 'driver' => 'beanstalkd',
47 | 'host' => 'localhost',
48 | 'queue' => 'default',
49 | 'retry_after' => 90,
50 | 'block_for' => 0,
51 | 'after_commit' => false,
52 | ],
53 |
54 | 'sqs' => [
55 | 'driver' => 'sqs',
56 | 'key' => env('AWS_ACCESS_KEY_ID'),
57 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
58 | 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
59 | 'queue' => env('SQS_QUEUE', 'default'),
60 | 'suffix' => env('SQS_SUFFIX'),
61 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
62 | 'after_commit' => false,
63 | ],
64 |
65 | 'redis' => [
66 | 'driver' => 'redis',
67 | 'connection' => 'default',
68 | 'queue' => env('REDIS_QUEUE', 'default'),
69 | 'retry_after' => 90,
70 | 'block_for' => null,
71 | 'after_commit' => false,
72 | ],
73 |
74 | ],
75 |
76 | /*
77 | |--------------------------------------------------------------------------
78 | | Job Batching
79 | |--------------------------------------------------------------------------
80 | |
81 | | The following options configure the database and table that store job
82 | | batching information. These options can be updated to any database
83 | | connection and table which has been defined by your application.
84 | |
85 | */
86 |
87 | 'batching' => [
88 | 'database' => env('DB_CONNECTION', 'mysql'),
89 | 'table' => 'job_batches',
90 | ],
91 |
92 | /*
93 | |--------------------------------------------------------------------------
94 | | Failed Queue Jobs
95 | |--------------------------------------------------------------------------
96 | |
97 | | These options configure the behavior of failed queue job logging so you
98 | | can control which database and table are used to store the jobs that
99 | | have failed. You may change them to any database / table you wish.
100 | |
101 | */
102 |
103 | 'failed' => [
104 | 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
105 | 'database' => env('DB_CONNECTION', 'mysql'),
106 | 'table' => 'failed_jobs',
107 | ],
108 |
109 | ];
110 |
--------------------------------------------------------------------------------
/config/sanctum.php:
--------------------------------------------------------------------------------
1 | explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(
19 | '%s%s',
20 | 'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1',
21 | Sanctum::currentApplicationUrlWithPort()
22 | ))),
23 |
24 | /*
25 | |--------------------------------------------------------------------------
26 | | Sanctum Guards
27 | |--------------------------------------------------------------------------
28 | |
29 | | This array contains the authentication guards that will be checked when
30 | | Sanctum is trying to authenticate a request. If none of these guards
31 | | are able to authenticate the request, Sanctum will use the bearer
32 | | token that's present on an incoming request for authentication.
33 | |
34 | */
35 |
36 | 'guard' => ['web'],
37 |
38 | /*
39 | |--------------------------------------------------------------------------
40 | | Expiration Minutes
41 | |--------------------------------------------------------------------------
42 | |
43 | | This value controls the number of minutes until an issued token will be
44 | | considered expired. If this value is null, personal access tokens do
45 | | not expire. This won't tweak the lifetime of first-party sessions.
46 | |
47 | */
48 |
49 | 'expiration' => null,
50 |
51 | /*
52 | |--------------------------------------------------------------------------
53 | | Sanctum Middleware
54 | |--------------------------------------------------------------------------
55 | |
56 | | When authenticating your first-party SPA with Sanctum you may need to
57 | | customize some of the middleware Sanctum uses while processing the
58 | | request. You may change the middleware listed below as required.
59 | |
60 | */
61 |
62 | 'middleware' => [
63 | 'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class,
64 | 'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class,
65 | ],
66 |
67 | ];
68 |
--------------------------------------------------------------------------------
/config/services.php:
--------------------------------------------------------------------------------
1 | [
18 | 'domain' => env('MAILGUN_DOMAIN'),
19 | 'secret' => env('MAILGUN_SECRET'),
20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
21 | 'scheme' => 'https',
22 | ],
23 |
24 | 'postmark' => [
25 | 'token' => env('POSTMARK_TOKEN'),
26 | ],
27 |
28 | 'ses' => [
29 | 'key' => env('AWS_ACCESS_KEY_ID'),
30 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
31 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
32 | ],
33 |
34 | ];
35 |
--------------------------------------------------------------------------------
/config/session.php:
--------------------------------------------------------------------------------
1 | env('SESSION_DRIVER', 'file'),
22 |
23 | /*
24 | |--------------------------------------------------------------------------
25 | | Session Lifetime
26 | |--------------------------------------------------------------------------
27 | |
28 | | Here you may specify the number of minutes that you wish the session
29 | | to be allowed to remain idle before it expires. If you want them
30 | | to immediately expire on the browser closing, set that option.
31 | |
32 | */
33 |
34 | 'lifetime' => env('SESSION_LIFETIME', 120),
35 |
36 | 'expire_on_close' => false,
37 |
38 | /*
39 | |--------------------------------------------------------------------------
40 | | Session Encryption
41 | |--------------------------------------------------------------------------
42 | |
43 | | This option allows you to easily specify that all of your session data
44 | | should be encrypted before it is stored. All encryption will be run
45 | | automatically by Laravel and you can use the Session like normal.
46 | |
47 | */
48 |
49 | 'encrypt' => false,
50 |
51 | /*
52 | |--------------------------------------------------------------------------
53 | | Session File Location
54 | |--------------------------------------------------------------------------
55 | |
56 | | When using the native session driver, we need a location where session
57 | | files may be stored. A default has been set for you but a different
58 | | location may be specified. This is only needed for file sessions.
59 | |
60 | */
61 |
62 | 'files' => storage_path('framework/sessions'),
63 |
64 | /*
65 | |--------------------------------------------------------------------------
66 | | Session Database Connection
67 | |--------------------------------------------------------------------------
68 | |
69 | | When using the "database" or "redis" session drivers, you may specify a
70 | | connection that should be used to manage these sessions. This should
71 | | correspond to a connection in your database configuration options.
72 | |
73 | */
74 |
75 | 'connection' => env('SESSION_CONNECTION'),
76 |
77 | /*
78 | |--------------------------------------------------------------------------
79 | | Session Database Table
80 | |--------------------------------------------------------------------------
81 | |
82 | | When using the "database" session driver, you may specify the table we
83 | | should use to manage the sessions. Of course, a sensible default is
84 | | provided for you; however, you are free to change this as needed.
85 | |
86 | */
87 |
88 | 'table' => 'sessions',
89 |
90 | /*
91 | |--------------------------------------------------------------------------
92 | | Session Cache Store
93 | |--------------------------------------------------------------------------
94 | |
95 | | While using one of the framework's cache driven session backends you may
96 | | list a cache store that should be used for these sessions. This value
97 | | must match with one of the application's configured cache "stores".
98 | |
99 | | Affects: "apc", "dynamodb", "memcached", "redis"
100 | |
101 | */
102 |
103 | 'store' => env('SESSION_STORE'),
104 |
105 | /*
106 | |--------------------------------------------------------------------------
107 | | Session Sweeping Lottery
108 | |--------------------------------------------------------------------------
109 | |
110 | | Some session drivers must manually sweep their storage location to get
111 | | rid of old sessions from storage. Here are the chances that it will
112 | | happen on a given request. By default, the odds are 2 out of 100.
113 | |
114 | */
115 |
116 | 'lottery' => [2, 100],
117 |
118 | /*
119 | |--------------------------------------------------------------------------
120 | | Session Cookie Name
121 | |--------------------------------------------------------------------------
122 | |
123 | | Here you may change the name of the cookie used to identify a session
124 | | instance by ID. The name specified here will get used every time a
125 | | new session cookie is created by the framework for every driver.
126 | |
127 | */
128 |
129 | 'cookie' => env(
130 | 'SESSION_COOKIE',
131 | Str::slug(env('APP_NAME', 'laravel'), '_').'_session'
132 | ),
133 |
134 | /*
135 | |--------------------------------------------------------------------------
136 | | Session Cookie Path
137 | |--------------------------------------------------------------------------
138 | |
139 | | The session cookie path determines the path for which the cookie will
140 | | be regarded as available. Typically, this will be the root path of
141 | | your application but you are free to change this when necessary.
142 | |
143 | */
144 |
145 | 'path' => '/',
146 |
147 | /*
148 | |--------------------------------------------------------------------------
149 | | Session Cookie Domain
150 | |--------------------------------------------------------------------------
151 | |
152 | | Here you may change the domain of the cookie used to identify a session
153 | | in your application. This will determine which domains the cookie is
154 | | available to in your application. A sensible default has been set.
155 | |
156 | */
157 |
158 | 'domain' => env('SESSION_DOMAIN'),
159 |
160 | /*
161 | |--------------------------------------------------------------------------
162 | | HTTPS Only Cookies
163 | |--------------------------------------------------------------------------
164 | |
165 | | By setting this option to true, session cookies will only be sent back
166 | | to the server if the browser has a HTTPS connection. This will keep
167 | | the cookie from being sent to you when it can't be done securely.
168 | |
169 | */
170 |
171 | 'secure' => env('SESSION_SECURE_COOKIE'),
172 |
173 | /*
174 | |--------------------------------------------------------------------------
175 | | HTTP Access Only
176 | |--------------------------------------------------------------------------
177 | |
178 | | Setting this value to true will prevent JavaScript from accessing the
179 | | value of the cookie and the cookie will only be accessible through
180 | | the HTTP protocol. You are free to modify this option if needed.
181 | |
182 | */
183 |
184 | 'http_only' => true,
185 |
186 | /*
187 | |--------------------------------------------------------------------------
188 | | Same-Site Cookies
189 | |--------------------------------------------------------------------------
190 | |
191 | | This option determines how your cookies behave when cross-site requests
192 | | take place, and can be used to mitigate CSRF attacks. By default, we
193 | | will set this value to "lax" since this is a secure default value.
194 | |
195 | | Supported: "lax", "strict", "none", null
196 | |
197 | */
198 |
199 | 'same_site' => 'lax',
200 |
201 | ];
202 |
--------------------------------------------------------------------------------
/config/view.php:
--------------------------------------------------------------------------------
1 | [
17 | resource_path('views'),
18 | ],
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Compiled View Path
23 | |--------------------------------------------------------------------------
24 | |
25 | | This option determines where all the compiled Blade templates will be
26 | | stored for your application. Typically, this is within the storage
27 | | directory. However, as usual, you are free to change this value.
28 | |
29 | */
30 |
31 | 'compiled' => env(
32 | 'VIEW_COMPILED_PATH',
33 | realpath(storage_path('framework/views'))
34 | ),
35 |
36 | ];
37 |
--------------------------------------------------------------------------------
/database/.gitignore:
--------------------------------------------------------------------------------
1 | *.sqlite*
2 |
--------------------------------------------------------------------------------
/database/factories/UserFactory.php:
--------------------------------------------------------------------------------
1 |
10 | */
11 | class UserFactory extends Factory
12 | {
13 | /**
14 | * Define the model's default state.
15 | *
16 | * @return array
17 | */
18 | public function definition(): array
19 | {
20 | return [
21 | 'name' => fake()->name(),
22 | 'email' => fake()->unique()->safeEmail(),
23 | 'email_verified_at' => now(),
24 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
25 | 'remember_token' => Str::random(10),
26 | ];
27 | }
28 |
29 | /**
30 | * Indicate that the model's email address should be unverified.
31 | */
32 | public function unverified(): static
33 | {
34 | return $this->state(fn (array $attributes) => [
35 | 'email_verified_at' => null,
36 | ]);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/database/migrations/2014_10_12_000000_create_users_table.php:
--------------------------------------------------------------------------------
1 | id();
16 | $table->string('name');
17 | $table->string('email')->unique();
18 | $table->timestamp('email_verified_at')->nullable();
19 | $table->string('password');
20 | $table->rememberToken();
21 | $table->timestamps();
22 | });
23 | }
24 |
25 | /**
26 | * Reverse the migrations.
27 | */
28 | public function down(): void
29 | {
30 | Schema::dropIfExists('users');
31 | }
32 | };
33 |
--------------------------------------------------------------------------------
/database/migrations/2014_10_12_100000_create_password_reset_tokens_table.php:
--------------------------------------------------------------------------------
1 | string('email')->primary();
16 | $table->string('token');
17 | $table->timestamp('created_at')->nullable();
18 | });
19 | }
20 |
21 | /**
22 | * Reverse the migrations.
23 | */
24 | public function down(): void
25 | {
26 | Schema::dropIfExists('password_reset_tokens');
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/database/migrations/2019_08_19_000000_create_failed_jobs_table.php:
--------------------------------------------------------------------------------
1 | id();
16 | $table->string('uuid')->unique();
17 | $table->text('connection');
18 | $table->text('queue');
19 | $table->longText('payload');
20 | $table->longText('exception');
21 | $table->timestamp('failed_at')->useCurrent();
22 | });
23 | }
24 |
25 | /**
26 | * Reverse the migrations.
27 | */
28 | public function down(): void
29 | {
30 | Schema::dropIfExists('failed_jobs');
31 | }
32 | };
33 |
--------------------------------------------------------------------------------
/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php:
--------------------------------------------------------------------------------
1 | id();
16 | $table->morphs('tokenable');
17 | $table->string('name');
18 | $table->string('token', 64)->unique();
19 | $table->text('abilities')->nullable();
20 | $table->timestamp('last_used_at')->nullable();
21 | $table->timestamp('expires_at')->nullable();
22 | $table->timestamps();
23 | });
24 | }
25 |
26 | /**
27 | * Reverse the migrations.
28 | */
29 | public function down(): void
30 | {
31 | Schema::dropIfExists('personal_access_tokens');
32 | }
33 | };
34 |
--------------------------------------------------------------------------------
/database/migrations/2023_08_17_132209_create_categories_table.php:
--------------------------------------------------------------------------------
1 | id();
16 | $table->string('name');
17 | $table->string('slug')->unique();
18 | $table->foreignId('parent_id')
19 | ->nullable()
20 | ->constrained('categories')
21 | ->cascadeOnDelete();
22 | $table->boolean('is_visible')->default(false);
23 | $table->longText('description')->nullable();
24 | $table->timestamps();
25 | });
26 | }
27 |
28 | /**
29 | * Reverse the migrations.
30 | */
31 | public function down(): void
32 | {
33 | Schema::dropIfExists('categories');
34 | }
35 | };
36 |
--------------------------------------------------------------------------------
/database/migrations/2023_08_17_132215_create_brands_table.php:
--------------------------------------------------------------------------------
1 | id();
16 | $table->string('name');
17 | $table->string('slug')->unique();
18 | $table->string('url')->nullable();
19 | $table->string('primary_hex')->nullable();
20 | $table->boolean('is_visible')->default(false);
21 | $table->longText('description')->nullable();
22 | $table->timestamps();
23 | });
24 | }
25 |
26 | /**
27 | * Reverse the migrations.
28 | */
29 | public function down(): void
30 | {
31 | Schema::dropIfExists('brands');
32 | }
33 | };
34 |
--------------------------------------------------------------------------------
/database/migrations/2023_08_17_132244_create_products_table.php:
--------------------------------------------------------------------------------
1 | id();
16 | $table->foreignId('brand_id')
17 | ->constrained('brands')
18 | ->cascadeOnDelete();
19 | $table->string('name');
20 | $table->string('slug')->unique();
21 | $table->string('sku')->unique();
22 | $table->string('image');
23 | $table->longText('description')->nullable();
24 | $table->unsignedBigInteger('quantity');
25 | $table->decimal('price', 10, 2);
26 | $table->boolean('is_visible')->default(false);
27 | $table->boolean('is_featured')->default(false);
28 | $table->enum('type', ['deliverable', 'downloadable'])
29 | ->default('deliverable');
30 | $table->date('published_at');
31 | $table->timestamps();
32 | });
33 | }
34 |
35 | /**
36 | * Reverse the migrations.
37 | */
38 | public function down(): void
39 | {
40 | Schema::dropIfExists('products');
41 | }
42 | };
43 |
--------------------------------------------------------------------------------
/database/migrations/2023_08_17_132249_create_customers_table.php:
--------------------------------------------------------------------------------
1 | id();
16 | $table->string('name');
17 | $table->string('email')->unique();
18 | $table->string('phone');
19 | $table->date('date_of_birth');
20 | $table->string('address');
21 | $table->string('zip_code');
22 | $table->string('city');
23 | $table->timestamps();
24 | });
25 | }
26 |
27 | /**
28 | * Reverse the migrations.
29 | */
30 | public function down(): void
31 | {
32 | Schema::dropIfExists('customers');
33 | }
34 | };
35 |
--------------------------------------------------------------------------------
/database/migrations/2023_08_17_132319_create_orders_table.php:
--------------------------------------------------------------------------------
1 | id();
16 | $table->foreignId('customer_id')
17 | ->constrained('customers')
18 | ->cascadeOnDelete();
19 | $table->string('number')->unique();
20 | $table->decimal('total_price', 10, 2);
21 | $table->enum('status', ['pending', 'processing', 'completed', 'declined'])
22 | ->default('pending');
23 | $table->decimal('shipping_price')->nullable();
24 | $table->longText('notes');
25 | $table->softDeletes();
26 | $table->timestamps();
27 | });
28 | }
29 |
30 | /**
31 | * Reverse the migrations.
32 | */
33 | public function down(): void
34 | {
35 | Schema::dropIfExists('orders');
36 | }
37 | };
38 |
--------------------------------------------------------------------------------
/database/migrations/2023_08_17_135532_create_order_items_table.php:
--------------------------------------------------------------------------------
1 | id();
16 | $table->foreignId('order_id')
17 | ->constrained('orders')
18 | ->cascadeOnDelete();
19 | $table->foreignId('product_id')
20 | ->constrained('products')
21 | ->cascadeOnDelete();
22 | $table->unsignedBigInteger('quantity');
23 | $table->decimal('unit_price', 10, 2);
24 | $table->timestamps();
25 | });
26 | }
27 |
28 | /**
29 | * Reverse the migrations.
30 | */
31 | public function down(): void
32 | {
33 | Schema::dropIfExists('order_items');
34 | }
35 | };
36 |
--------------------------------------------------------------------------------
/database/migrations/2023_08_17_135924_create_category_product_table.php:
--------------------------------------------------------------------------------
1 | foreignId('category_id')
16 | ->constrained('categories')
17 | ->cascadeOnDelete();
18 | $table->foreignId('product_id')
19 | ->constrained('products')
20 | ->cascadeOnDelete();
21 | });
22 | }
23 |
24 | /**
25 | * Reverse the migrations.
26 | */
27 | public function down(): void
28 | {
29 | Schema::dropIfExists('category_product');
30 | }
31 | };
32 |
--------------------------------------------------------------------------------
/database/migrations/2023_09_04_131928_delete_total_price_from_orders_table.php:
--------------------------------------------------------------------------------
1 | dropColumn('total_price');
16 | });
17 | }
18 |
19 | /**
20 | * Reverse the migrations.
21 | */
22 | public function down(): void
23 | {
24 | Schema::table('orders', function (Blueprint $table) {
25 | //
26 | });
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/database/seeders/DatabaseSeeder.php:
--------------------------------------------------------------------------------
1 | create();
16 |
17 | // \App\Models\User::factory()->create([
18 | // 'name' => 'Test User',
19 | // 'email' => 'test@example.com',
20 | // ]);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "type": "module",
4 | "scripts": {
5 | "dev": "vite",
6 | "build": "vite build"
7 | },
8 | "devDependencies": {
9 | "axios": "^1.1.2",
10 | "laravel-vite-plugin": "^0.7.5",
11 | "vite": "^4.0.0"
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/phpunit.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 | tests/Unit
10 |
11 |
12 | tests/Feature
13 |
14 |
15 |
16 |
17 | app
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/public/.htaccess:
--------------------------------------------------------------------------------
1 |
2 |
3 | Options -MultiViews -Indexes
4 |
5 |
6 | RewriteEngine On
7 |
8 | # Handle Authorization Header
9 | RewriteCond %{HTTP:Authorization} .
10 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
11 |
12 | # Redirect Trailing Slashes If Not A Folder...
13 | RewriteCond %{REQUEST_FILENAME} !-d
14 | RewriteCond %{REQUEST_URI} (.+)/$
15 | RewriteRule ^ %1 [L,R=301]
16 |
17 | # Send Requests To Front Controller...
18 | RewriteCond %{REQUEST_FILENAME} !-d
19 | RewriteCond %{REQUEST_FILENAME} !-f
20 | RewriteRule ^ index.php [L]
21 |
22 |
--------------------------------------------------------------------------------
/public/css/filament/support/support.css:
--------------------------------------------------------------------------------
1 | .tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}.tippy-box[data-theme~=light]{color:#26323d;box-shadow:0 0 20px 4px #9aa1b126,0 4px 80px -8px #24282f40,0 4px 4px -2px #5b5e6926;background-color:#fff}.tippy-box[data-theme~=light][data-placement^=top]>.tippy-arrow:before{border-top-color:#fff}.tippy-box[data-theme~=light][data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:#fff}.tippy-box[data-theme~=light][data-placement^=left]>.tippy-arrow:before{border-left-color:#fff}.tippy-box[data-theme~=light][data-placement^=right]>.tippy-arrow:before{border-right-color:#fff}.tippy-box[data-theme~=light]>.tippy-backdrop{background-color:#fff}.tippy-box[data-theme~=light]>.tippy-svg-arrow{fill:#fff}
2 |
--------------------------------------------------------------------------------
/public/css/pxlrbt/filament-spotlight/spotlight-css.css:
--------------------------------------------------------------------------------
1 | .right-5{right:1.25rem}.scale-100,.scale-95{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-100{--tw-scale-x:1;--tw-scale-y:1}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.border-gray-800{--tw-border-opacity:1;border-color:rgb(31 41 55/var(--tw-border-opacity))}.bg-gray-900{--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity))}.bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.pt-16{padding-top:4rem}.placeholder-gray-500:-ms-input-placeholder{--tw-placeholder-opacity:1;color:rgb(107 114 128/var(--tw-placeholder-opacity))}.opacity-75{opacity:.75}.duration-150{transition-duration:.15s}[x-cloak=""]{display:none!important}.hover\:bg-gray-800:hover{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity))}.focus\:border-0:focus{border-width:0}.focus\:border-transparent:focus{border-color:transparent}.focus\:shadow-none:focus{--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}@media (min-width:640px){.sm\:pt-24{padding-top:6rem}}
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codewithdary/hostinger-filament/e6d09f8675bdad5a0ab37f71e1baba135aa36617/public/favicon.ico
--------------------------------------------------------------------------------
/public/images/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codewithdary/hostinger-filament/e6d09f8675bdad5a0ab37f71e1baba135aa36617/public/images/favicon.png
--------------------------------------------------------------------------------
/public/images/hostinger-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codewithdary/hostinger-filament/e6d09f8675bdad5a0ab37f71e1baba135aa36617/public/images/hostinger-logo.png
--------------------------------------------------------------------------------
/public/index.php:
--------------------------------------------------------------------------------
1 | make(Kernel::class);
50 |
51 | $response = $kernel->handle(
52 | $request = Request::capture()
53 | )->send();
54 |
55 | $kernel->terminate($request, $response);
56 |
--------------------------------------------------------------------------------
/public/js/filament/filament/app.js:
--------------------------------------------------------------------------------
1 | (()=>{var Z=Object.create,L=Object.defineProperty,ee=Object.getPrototypeOf,te=Object.prototype.hasOwnProperty,re=Object.getOwnPropertyNames,ne=Object.getOwnPropertyDescriptor,ae=o=>L(o,"__esModule",{value:!0}),ie=(o,n)=>()=>(n||(n={exports:{}},o(n.exports,n)),n.exports),se=(o,n,p)=>{if(n&&typeof n=="object"||typeof n=="function")for(let d of re(n))!te.call(o,d)&&d!=="default"&&L(o,d,{get:()=>n[d],enumerable:!(p=ne(n,d))||p.enumerable});return o},oe=o=>se(ae(L(o!=null?Z(ee(o)):{},"default",o&&o.__esModule&&"default"in o?{get:()=>o.default,enumerable:!0}:{value:o,enumerable:!0})),o),fe=ie((o,n)=>{(function(p,d,P){if(!p)return;for(var h={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},y={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},g={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},q={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},S,w=1;w<20;++w)h[111+w]="f"+w;for(w=0;w<=9;++w)h[w+96]=w.toString();function O(e,t,a){if(e.addEventListener){e.addEventListener(t,a,!1);return}e.attachEvent("on"+t,a)}function T(e){if(e.type=="keypress"){var t=String.fromCharCode(e.which);return e.shiftKey||(t=t.toLowerCase()),t}return h[e.which]?h[e.which]:y[e.which]?y[e.which]:String.fromCharCode(e.which).toLowerCase()}function $(e,t){return e.sort().join(",")===t.sort().join(",")}function B(e){var t=[];return e.shiftKey&&t.push("shift"),e.altKey&&t.push("alt"),e.ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),t}function V(e){if(e.preventDefault){e.preventDefault();return}e.returnValue=!1}function H(e){if(e.stopPropagation){e.stopPropagation();return}e.cancelBubble=!0}function C(e){return e=="shift"||e=="ctrl"||e=="alt"||e=="meta"}function J(){if(!S){S={};for(var e in h)e>95&&e<112||h.hasOwnProperty(e)&&(S[h[e]]=e)}return S}function U(e,t,a){return a||(a=J()[e]?"keydown":"keypress"),a=="keypress"&&t.length&&(a="keydown"),a}function X(e){return e==="+"?["+"]:(e=e.replace(/\+{2}/g,"+plus"),e.split("+"))}function I(e,t){var a,c,b,M=[];for(a=X(e),b=0;b1){z(r,m,s,l);return}f=I(r,l),t._callbacks[f.key]=t._callbacks[f.key]||[],j(f.key,f.modifiers,{type:f.action},i,r,u),t._callbacks[f.key][i?"unshift":"push"]({callback:s,modifiers:f.modifiers,action:f.action,seq:i,level:u,combo:r})}t._bindMultiple=function(r,s,l){for(var i=0;i-1||D(t,a.target))return!1;if("composedPath"in e&&typeof e.composedPath=="function"){var c=e.composedPath()[0];c!==e.target&&(t=c)}return t.tagName=="INPUT"||t.tagName=="SELECT"||t.tagName=="TEXTAREA"||t.isContentEditable},v.prototype.handleKey=function(){var e=this;return e._handleKey.apply(e,arguments)},v.addKeycodes=function(e){for(var t in e)e.hasOwnProperty(t)&&(h[t]=e[t]);S=null},v.init=function(){var e=v(d);for(var t in e)t.charAt(0)!=="_"&&(v[t]=function(a){return function(){return e[a].apply(e,arguments)}}(t))},v.init(),p.Mousetrap=v,typeof n<"u"&&n.exports&&(n.exports=v),typeof define=="function"&&define.amd&&define(function(){return v})})(typeof window<"u"?window:null,typeof window<"u"?document:null)}),R=oe(fe());(function(o){if(o){var n={},p=o.prototype.stopCallback;o.prototype.stopCallback=function(d,P,h,y){var g=this;return g.paused?!0:n[h]||n[y]?!1:p.call(g,d,P,h)},o.prototype.bindGlobal=function(d,P,h){var y=this;if(y.bind(d,P,h),d instanceof Array){for(var g=0;g{o.directive("mousetrap",(n,{modifiers:p,expression:d},{evaluate:P})=>{let h=()=>d?P(d):n.click();p=p.map(y=>y.replace("-","+")),p.includes("global")&&(p=p.filter(y=>y!=="global"),R.default.bindGlobal(p,y=>{y.preventDefault(),h()})),R.default.bind(p,y=>{y.preventDefault(),h()})})},F=le;document.addEventListener("alpine:init",()=>{window.Alpine.plugin(F),window.Alpine.store("sidebar",{isOpen:window.Alpine.$persist(!0).as("isOpen"),collapsedGroups:window.Alpine.$persist(null).as("collapsedGroups"),groupIsCollapsed:function(n){return this.collapsedGroups.includes(n)},collapseGroup:function(n){this.collapsedGroups.includes(n)||(this.collapsedGroups=this.collapsedGroups.concat(n))},toggleCollapsedGroup:function(n){this.collapsedGroups=this.collapsedGroups.includes(n)?this.collapsedGroups.filter(p=>p!==n):this.collapsedGroups.concat(n)},close:function(){this.isOpen=!1},open:function(){this.isOpen=!0}});let o=localStorage.getItem("theme")??"system";window.Alpine.store("theme",o==="dark"||o==="system"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),window.addEventListener("theme-changed",n=>{let p=n.detail;localStorage.setItem("theme",p),p==="system"&&(p=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),window.Alpine.store("theme",p)}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",n=>{localStorage.getItem("theme")==="system"&&window.Alpine.store("theme",n.matches?"dark":"light")}),window.Alpine.effect(()=>{window.Alpine.store("theme")==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")})});})();
2 |
--------------------------------------------------------------------------------
/public/js/filament/forms/components/color-picker.js:
--------------------------------------------------------------------------------
1 | var l=(e,t=0,r=1)=>e>r?r:eMath.round(r*e)/r;var nt={grad:360/400,turn:360,rad:360/(Math.PI*2)},B=e=>J(x(e)),x=e=>(e[0]==="#"&&(e=e.substr(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:1}:{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:1}),it=(e,t="deg")=>Number(e)*(nt[t]||1),lt=e=>{let r=/hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return r?ct({h:it(r[1],r[2]),s:Number(r[3]),l:Number(r[4]),a:r[5]===void 0?1:Number(r[5])/(r[6]?100:1)}):{h:0,s:0,v:0,a:1}},F=lt,ct=({h:e,s:t,l:r,a:s})=>(t*=(r<50?r:100-r)/100,{h:e,s:t>0?2*t/(r+t)*100:0,v:r+t,a:s}),X=e=>pt(N(e)),Y=({h:e,s:t,v:r,a:s})=>{let o=(200-t)*r/100;return{h:a(e),s:a(o>0&&o<200?t*r/100/(o<=100?o:200-o)*100:0),l:a(o/2),a:a(s,2)}};var u=e=>{let{h:t,s:r,l:s}=Y(e);return`hsl(${t}, ${r}%, ${s}%)`},b=e=>{let{h:t,s:r,l:s,a:o}=Y(e);return`hsla(${t}, ${r}%, ${s}%, ${o})`},N=({h:e,s:t,v:r,a:s})=>{e=e/360*6,t=t/100,r=r/100;let o=Math.floor(e),n=r*(1-t),i=r*(1-(e-o)*t),E=r*(1-(1-e+o)*t),q=o%6;return{r:a([r,i,n,n,E,r][q]*255),g:a([E,r,r,i,n,n][q]*255),b:a([n,n,E,r,r,i][q]*255),a:a(s,2)}},_=e=>{let{r:t,g:r,b:s}=N(e);return`rgb(${t}, ${r}, ${s})`},U=e=>{let{r:t,g:r,b:s,a:o}=N(e);return`rgba(${t}, ${r}, ${s}, ${o})`};var A=e=>{let r=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return r?J({r:Number(r[1])/(r[2]?100/255:1),g:Number(r[3])/(r[4]?100/255:1),b:Number(r[5])/(r[6]?100/255:1),a:r[7]===void 0?1:Number(r[7])/(r[8]?100:1)}):{h:0,s:0,v:0,a:1}},G=A,L=e=>{let t=e.toString(16);return t.length<2?"0"+t:t},pt=({r:e,g:t,b:r})=>"#"+L(e)+L(t)+L(r),J=({r:e,g:t,b:r,a:s})=>{let o=Math.max(e,t,r),n=o-Math.min(e,t,r),i=n?o===e?(t-r)/n:o===t?2+(r-e)/n:4+(e-t)/n:0;return{h:a(60*(i<0?i+6:i)),s:a(o?n/o*100:0),v:a(o/255*100),a:s}};var I=(e,t)=>{if(e===t)return!0;for(let r in e)if(e[r]!==t[r])return!1;return!0},d=(e,t)=>e.replace(/\s/g,"")===t.replace(/\s/g,""),K=(e,t)=>e.toLowerCase()===t.toLowerCase()?!0:I(x(e),x(t));var Q={},v=e=>{let t=Q[e];return t||(t=document.createElement("template"),t.innerHTML=e,Q[e]=t),t},m=(e,t,r)=>{e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))};var h=!1,O=e=>"touches"in e,ut=e=>h&&!O(e)?!1:(h||(h=O(e)),!0),W=(e,t)=>{let r=O(t)?t.touches[0]:t,s=e.el.getBoundingClientRect();m(e.el,"move",e.getMove({x:l((r.pageX-(s.left+window.pageXOffset))/s.width),y:l((r.pageY-(s.top+window.pageYOffset))/s.height)}))},dt=(e,t)=>{let r=t.keyCode;r>40||e.xy&&r<37||r<33||(t.preventDefault(),m(e.el,"move",e.getMove({x:r===39?.01:r===37?-.01:r===34?.05:r===33?-.05:r===35?1:r===36?-1:0,y:r===40?.01:r===38?-.01:0},!0)))},p=class{constructor(t,r,s,o){let n=v(``);t.appendChild(n.content.cloneNode(!0));let i=t.querySelector(`[part=${r}]`);i.addEventListener("mousedown",this),i.addEventListener("touchstart",this),i.addEventListener("keydown",this),this.el=i,this.xy=o,this.nodes=[i.firstChild,i]}set dragging(t){let r=t?document.addEventListener:document.removeEventListener;r(h?"touchmove":"mousemove",this),r(h?"touchend":"mouseup",this)}handleEvent(t){switch(t.type){case"mousedown":case"touchstart":if(t.preventDefault(),!ut(t)||!h&&t.button!=0)return;this.el.focus(),W(this,t),this.dragging=!0;break;case"mousemove":case"touchmove":t.preventDefault(),W(this,t);break;case"mouseup":case"touchend":this.dragging=!1;break;case"keydown":dt(this,t);break}}style(t){t.forEach((r,s)=>{for(let o in r)this.nodes[s].style.setProperty(o,r[o])})}};var $=class extends p{constructor(t){super(t,"hue",'aria-label="Hue" aria-valuemin="0" aria-valuemax="360"',!1)}update({h:t}){this.h=t,this.style([{left:`${t/360*100}%`,color:u({h:t,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuenow",`${a(t)}`)}getMove(t,r){return{h:r?l(this.h+t.x*360,0,360):360*t.x}}};var H=class extends p{constructor(t){super(t,"saturation",'aria-label="Color"',!0)}update(t){this.hsva=t,this.style([{top:`${100-t.v}%`,left:`${t.s}%`,color:u(t)},{"background-color":u({h:t.h,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuetext",`Saturation ${a(t.s)}%, Brightness ${a(t.v)}%`)}getMove(t,r){return{s:r?l(this.hsva.s+t.x*100,0,100):t.x*100,v:r?l(this.hsva.v-t.y*100,0,100):Math.round(100-t.y*100)}}};var Z=":host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{display:block;content:'';position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}";var tt="[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}";var rt="[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}";var S=Symbol("same"),et=Symbol("color"),ot=Symbol("hsva"),R=Symbol("change"),P=Symbol("update"),st=Symbol("parts"),f=Symbol("css"),g=Symbol("sliders"),c=class extends HTMLElement{static get observedAttributes(){return["color"]}get[f](){return[Z,tt,rt]}get[g](){return[H,$]}get color(){return this[et]}set color(t){if(!this[S](t)){let r=this.colorModel.toHsva(t);this[P](r),this[R](t)}}constructor(){super();let t=v(``),r=this.attachShadow({mode:"open"});r.appendChild(t.content.cloneNode(!0)),r.addEventListener("move",this),this[st]=this[g].map(s=>new s(r))}connectedCallback(){if(this.hasOwnProperty("color")){let t=this.color;delete this.color,this.color=t}else this.color||(this.color=this.colorModel.defaultColor)}attributeChangedCallback(t,r,s){let o=this.colorModel.fromAttr(s);this[S](o)||(this.color=o)}handleEvent(t){let r=this[ot],s={...r,...t.detail};this[P](s);let o;!I(s,r)&&!this[S](o=this.colorModel.fromHsva(s))&&this[R](o)}[S](t){return this.color&&this.colorModel.equal(t,this.color)}[P](t){this[ot]=t,this[st].forEach(r=>r.update(t))}[R](t){this[et]=t,m(this,"color-changed",{value:t})}};var ht={defaultColor:"#000",toHsva:B,fromHsva:X,equal:K,fromAttr:e=>e},y=class extends c{get colorModel(){return ht}};var z=class extends y{};customElements.define("hex-color-picker",z);var mt={defaultColor:"hsl(0, 0%, 0%)",toHsva:F,fromHsva:u,equal:d,fromAttr:e=>e},T=class extends c{get colorModel(){return mt}};var V=class extends T{};customElements.define("hsl-string-color-picker",V);var ft={defaultColor:"rgb(0, 0, 0)",toHsva:G,fromHsva:_,equal:d,fromAttr:e=>e},w=class extends c{get colorModel(){return ft}};var j=class extends w{};customElements.define("rgb-string-color-picker",j);var M=class extends p{constructor(t){super(t,"alpha",'aria-label="Alpha" aria-valuemin="0" aria-valuemax="1"',!1)}update(t){this.hsva=t;let r=b({...t,a:0}),s=b({...t,a:1}),o=t.a*100;this.style([{left:`${o}%`,color:b(t)},{"--gradient":`linear-gradient(90deg, ${r}, ${s}`}]);let n=a(o);this.el.setAttribute("aria-valuenow",`${n}`),this.el.setAttribute("aria-valuetext",`${n}%`)}getMove(t,r){return{a:r?l(this.hsva.a+t.x):t.x}}};var at=`[part=alpha]{flex:0 0 24px}[part=alpha]::after{display:block;content:'';position:absolute;top:0;left:0;right:0;bottom:0;border-radius:inherit;background-image:var(--gradient);box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part^=alpha]{background-color:#fff;background-image:url('data:image/svg+xml,')}[part=alpha-pointer]{top:50%}`;var k=class extends c{get[f](){return[...super[f],at]}get[g](){return[...super[g],M]}};var gt={defaultColor:"rgba(0, 0, 0, 1)",toHsva:A,fromHsva:U,equal:d,fromAttr:e=>e},C=class extends k{get colorModel(){return gt}};var D=class extends C{};customElements.define("rgba-string-color-picker",D);function xt({isAutofocused:e,isDisabled:t,isLiveOnPickerClose:r,state:s}){return{state:s,init:function(){this.state===null||this.state===""||this.setState(this.state),e&&this.togglePanelVisibility(this.$refs.input),this.$refs.input.addEventListener("change",o=>{this.setState(o.target.value)}),this.$refs.panel.addEventListener("color-changed",o=>{this.setState(o.detail.value)}),r&&new MutationObserver(()=>{this.$refs.panel.style.display==="none"&&this.$wire.call("$refresh")}).observe(this.$refs.panel,{attributes:!0,childList:!0})},togglePanelVisibility:function(){t||this.$refs.panel.toggle(this.$refs.input)},setState:function(o){this.state=o,this.$refs.input.value=o,this.$refs.panel.color=o},isOpen:function(){return this.$refs.panel.style.display==="block"}}}export{xt as default};
2 |
--------------------------------------------------------------------------------
/public/js/filament/forms/components/key-value.js:
--------------------------------------------------------------------------------
1 | function i({state:o}){return{state:o,rows:[],shouldUpdateRows:!0,init:function(){this.updateRows(),this.rows.length<=0&&this.addRow(),this.shouldUpdateRows=!0,this.$watch("state",()=>{if(!this.shouldUpdateRows){this.shouldUpdateRows=!0;return}this.updateRows()})},addRow:function(){this.rows.push({key:"",value:""}),this.updateState()},deleteRow:function(t){this.rows.splice(t,1),this.rows.length<=0&&this.addRow(),this.updateState(),this.shouldUpdateRows=!0},reorderRows:function(t){let e=Alpine.raw(this.rows),s=e.splice(t.oldIndex,1)[0];e.splice(t.newIndex,0,s),this.rows=e,this.updateState()},updateRows:function(){let t=[];for(let[e,s]of Object.entries(this.state??{}))t.push({key:e,value:s});this.rows=t},updateState:function(){let t={};this.rows.forEach(e=>{e.key===""||e.key===null||(t[e.key]=e.value)}),this.shouldUpdateRows=!1,this.state=t}}}export{i as default};
2 |
--------------------------------------------------------------------------------
/public/js/filament/forms/components/tags-input.js:
--------------------------------------------------------------------------------
1 | function i({state:a,splitKeys:n}){return{newTag:"",state:a,createTag:function(){if(this.newTag=this.newTag.trim(),this.newTag!==""){if(this.state.includes(this.newTag)){this.newTag="";return}this.state.push(this.newTag),this.newTag=""}},deleteTag:function(t){this.state=this.state.filter(e=>e!==t)},input:{["x-on:blur"]:"createTag()",["x-model"]:"newTag",["x-on:keydown"](t){["Enter",...n].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),this.createTag())},["x-on:paste"](){$nextTick(()=>{let t=n.map(e=>e.replace(/[/\-\\^$*+?.()|[\]{}]/g,"\\$&")).join("|");this.newTag.split(new RegExp(t,"g")).forEach(e=>{this.newTag=e,this.createTag()})})}}}}export{i as default};
2 |
--------------------------------------------------------------------------------
/public/js/filament/forms/components/textarea.js:
--------------------------------------------------------------------------------
1 | function t({initialHeight:e}){return{render:function(){this.$el.scrollHeight>0&&(this.$el.style.height=e+"rem",this.$el.style.height=this.$el.scrollHeight+"px")}}}export{t as default};
2 |
--------------------------------------------------------------------------------
/public/js/filament/forms/forms.js:
--------------------------------------------------------------------------------
1 | (()=>{function b(n){n.directive("mask",(e,{value:t,expression:u},{effect:f,evaluateLater:c})=>{let r=()=>u,l="";queueMicrotask(()=>{if(["function","dynamic"].includes(t)){let o=c(u);f(()=>{r=a=>{let s;return n.dontAutoEvaluateFunctions(()=>{o(d=>{s=typeof d=="function"?d(a):d},{scope:{$input:a,$money:I.bind({el:e})}})}),s},i(e,!1)})}else i(e,!1);e._x_model&&e._x_model.set(e.value)}),e.addEventListener("input",()=>i(e)),e.addEventListener("blur",()=>i(e,!1));function i(o,a=!0){let s=o.value,d=r(s);if(!d||d==="false")return!1;if(l.length-o.value.length===1)return l=o.value;let g=()=>{l=o.value=p(s,d)};a?k(o,d,()=>{g()}):g()}function p(o,a){if(o==="")return"";let s=h(a,o);return m(a,s)}}).before("model")}function k(n,e,t){let u=n.selectionStart,f=n.value;t();let c=f.slice(0,u),r=m(e,h(e,c)).length;n.setSelectionRange(r,r)}function h(n,e){let t=e,u="",f={9:/[0-9]/,a:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},c="";for(let r=0;r{let o="",a=0;for(let s=i.length-1;s>=0;s--)i[s]!==p&&(a===3?(o=i[s]+p+o,a=0):o=i[s]+o,a++);return o},c=n.startsWith("-")?"-":"",r=n.replaceAll(new RegExp(`[^0-9\\${e}]`,"g"),""),l=Array.from({length:r.split(e)[0].length}).fill("9").join("");return l=`${c}${f(l,t)}`,u>0&&n.includes(e)&&(l+=`${e}`+"9".repeat(u)),queueMicrotask(()=>{this.el.value.endsWith(e)||this.el.value[this.el.selectionStart-1]===e&&this.el.setSelectionRange(this.el.selectionStart-1,this.el.selectionStart-1)}),l}var v=b;document.addEventListener("alpine:init",()=>{window.Alpine.plugin(v)});})();
2 |
--------------------------------------------------------------------------------
/public/js/filament/notifications/notifications.js:
--------------------------------------------------------------------------------
1 | (()=>{var J=Object.create;var q=Object.defineProperty;var K=Object.getOwnPropertyDescriptor;var X=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,tt=Object.prototype.hasOwnProperty;var d=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var et=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of X(t))!tt.call(e,s)&&s!==i&&q(e,s,{get:()=>t[s],enumerable:!(n=K(t,s))||n.enumerable});return e};var it=(e,t,i)=>(i=e!=null?J(Z(e)):{},et(t||!e||!e.__esModule?q(i,"default",{value:e,enumerable:!0}):i,e));var T=d((Tt,F)=>{var x,A=typeof global<"u"&&(global.crypto||global.msCrypto);A&&A.getRandomValues&&(E=new Uint8Array(16),x=function(){return A.getRandomValues(E),E});var E;x||(S=new Array(16),x=function(){for(var e=0,t;e<16;e++)e&3||(t=Math.random()*4294967296),S[e]=t>>>((e&3)<<3)&255;return S});var S;F.exports=x});var D=d((Dt,L)=>{var V=[];for(p=0;p<256;++p)V[p]=(p+256).toString(16).substr(1);var p;function dt(e,t){var i=t||0,n=V;return n[e[i++]]+n[e[i++]]+n[e[i++]]+n[e[i++]]+"-"+n[e[i++]]+n[e[i++]]+"-"+n[e[i++]]+n[e[i++]]+"-"+n[e[i++]]+n[e[i++]]+"-"+n[e[i++]]+n[e[i++]]+n[e[i++]]+n[e[i++]]+n[e[i++]]+n[e[i++]]}L.exports=dt});var Q=d((Nt,I)=>{var ft=T(),pt=D(),h=ft(),vt=[h[0]|1,h[1],h[2],h[3],h[4],h[5]],G=(h[6]<<8|h[7])&16383,N=0,k=0;function xt(e,t,i){var n=t&&i||0,s=t||[];e=e||{};var r=e.clockseq!==void 0?e.clockseq:G,o=e.msecs!==void 0?e.msecs:new Date().getTime(),a=e.nsecs!==void 0?e.nsecs:k+1,l=o-N+(a-k)/1e4;if(l<0&&e.clockseq===void 0&&(r=r+1&16383),(l<0||o>N)&&e.nsecs===void 0&&(a=0),a>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");N=o,k=a,G=r,o+=122192928e5;var c=((o&268435455)*1e4+a)%4294967296;s[n++]=c>>>24&255,s[n++]=c>>>16&255,s[n++]=c>>>8&255,s[n++]=c&255;var u=o/4294967296*1e4&268435455;s[n++]=u>>>8&255,s[n++]=u&255,s[n++]=u>>>24&15|16,s[n++]=u>>>16&255,s[n++]=r>>>8|128,s[n++]=r&255;for(var $=e.node||vt,v=0;v<6;++v)s[n+v]=$[v];return t||pt(s)}I.exports=xt});var B=d((kt,z)=>{var mt=T(),gt=D();function wt(e,t,i){var n=t&&i||0;typeof e=="string"&&(t=e=="binary"?new Array(16):null,e=null),e=e||{};var s=e.random||(e.rng||mt)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,t)for(var r=0;r<16;++r)t[n+r]=s[r];return t||gt(s)}z.exports=wt});var H=d((Mt,j)=>{var _t=Q(),Y=B(),M=Y;M.v1=_t;M.v4=Y;j.exports=M});var nt=[],rt=[],st=[];function ot(e,t){e._x_attributeCleanups&&Object.entries(e._x_attributeCleanups).forEach(([i,n])=>{(t===void 0||t.includes(i))&&(n.forEach(s=>s()),delete e._x_attributeCleanups[i])})}var y=new MutationObserver(O),b=!1;function at(){y.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),b=!0}function ut(){ct(),y.disconnect(),b=!1}var f=[],_=!1;function ct(){f=f.concat(y.takeRecords()),f.length&&!_&&(_=!0,queueMicrotask(()=>{ht(),_=!1}))}function ht(){O(f),f.length=0}function C(e){if(!b)return e();ut();let t=e();return at(),t}var lt=!1,R=[];function O(e){if(lt){R=R.concat(e);return}let t=[],i=[],n=new Map,s=new Map;for(let r=0;ro.nodeType===1&&t.push(o)),e[r].removedNodes.forEach(o=>o.nodeType===1&&i.push(o))),e[r].type==="attributes")){let o=e[r].target,a=e[r].attributeName,l=e[r].oldValue,c=()=>{n.has(o)||n.set(o,[]),n.get(o).push({name:a,value:o.getAttribute(a)})},u=()=>{s.has(o)||s.set(o,[]),s.get(o).push(a)};o.hasAttribute(a)&&l===null?c():o.hasAttribute(a)?(u(),c()):u()}s.forEach((r,o)=>{ot(o,r)}),n.forEach((r,o)=>{nt.forEach(a=>a(o,r))});for(let r of i)if(!t.includes(r)&&(rt.forEach(o=>o(r)),r._x_cleanups))for(;r._x_cleanups.length;)r._x_cleanups.pop()();t.forEach(r=>{r._x_ignoreSelf=!0,r._x_ignore=!0});for(let r of t)i.includes(r)||r.isConnected&&(delete r._x_ignoreSelf,delete r._x_ignore,st.forEach(o=>o(r)),r._x_ignore=!0,r._x_ignoreSelf=!0);t.forEach(r=>{delete r._x_ignoreSelf,delete r._x_ignore}),t=null,i=null,n=null,s=null}function P(e,t=()=>{}){let i=!1;return function(){i?t.apply(this,arguments):(i=!0,e.apply(this,arguments))}}var U=e=>{e.data("notificationComponent",({notification:t})=>({isShown:!1,computedStyle:null,transitionDuration:null,transitionEasing:null,init:function(){this.computedStyle=window.getComputedStyle(this.$el),this.transitionDuration=parseFloat(this.computedStyle.transitionDuration)*1e3,this.transitionEasing=this.computedStyle.transitionTimingFunction,this.configureTransitions(),this.configureAnimations(),t.duration&&t.duration!=="persistent"&&setTimeout(()=>this.close(),t.duration),this.isShown=!0},configureTransitions:function(){let i=this.computedStyle.display,n=()=>{C(()=>{this.$el.style.setProperty("display",i),this.$el.style.setProperty("visibility","visible")}),this.$el._x_isShown=!0},s=()=>{C(()=>{this.$el._x_isShown?this.$el.style.setProperty("visibility","hidden"):this.$el.style.setProperty("display","none")})},r=P(o=>o?n():s(),o=>{this.$el._x_toggleAndCascadeWithTransitions(this.$el,o,n,s)});e.effect(()=>r(this.isShown))},configureAnimations:function(){let i;Livewire.hook("commit",({component:n,commit:s,succeed:r,fail:o,respond:a})=>{if(!n.snapshot.data.isFilamentNotificationsComponent)return;let l=()=>this.$el.getBoundingClientRect().top,c=l();a(()=>{i=()=>{this.isShown&&this.$el.animate([{transform:`translateY(${c-l()}px)`},{transform:"translateY(0px)"}],{duration:this.transitionDuration,easing:this.transitionEasing})},this.$el.getAnimations().forEach(u=>u.finish())}),r(({snapshot:u,effect:$})=>{i()})})},close:function(){this.isShown=!1,setTimeout(()=>window.dispatchEvent(new CustomEvent("notificationClosed",{detail:{id:t.id}})),this.transitionDuration)},markAsRead:function(){window.dispatchEvent(new CustomEvent("markedNotificationAsRead",{detail:{id:t.id}}))},markAsUnread:function(){window.dispatchEvent(new CustomEvent("markedNotificationAsUnread",{detail:{id:t.id}}))}}))};var W=it(H(),1),m=class{constructor(){return this.id((0,W.v4)()),this}id(t){return this.id=t,this}title(t){return this.title=t,this}body(t){return this.body=t,this}actions(t){return this.actions=t,this}status(t){switch(t){case"danger":this.danger();break;case"info":this.info();break;case"success":this.success();break;case"warning":this.warning();break}return this}color(t){return this.color=t,this}icon(t){return this.icon=t,this}iconColor(t){return this.iconColor=t,this}duration(t){return this.duration=t,this}seconds(t){return this.duration(t*1e3),this}persistent(){return this.duration("persistent"),this}danger(){return this.icon("heroicon-o-x-circle"),this.iconColor("danger"),this}info(){return this.icon("heroicon-o-information-circle"),this.iconColor("info"),this}success(){return this.icon("heroicon-o-check-circle"),this.iconColor("success"),this}warning(){return this.icon("heroicon-o-exclamation-circle"),this.iconColor("warning"),this}view(t){return this.view=t,this}viewData(t){return this.viewData=t,this}send(){return window.dispatchEvent(new CustomEvent("notificationSent",{detail:{notification:this}})),this}},g=class{constructor(t){return this.name(t),this}name(t){return this.name=t,this}color(t){return this.color=t,this}dispatch(t,i){return this.event(t),this.eventData(i),this}dispatchSelf(t,i){return this.dispatch(t,i),this.dispatchDirection="self",this}dispatchTo(t,i,n){return this.dispatch(i,n),this.dispatchDirection="to",this.dispatchToComponent=t,this}emit(t,i){return this.dispatch(t,i),this}emitSelf(t,i){return this.dispatchSelf(t,i),this}emitTo(t,i,n){return this.dispatchTo(t,i,n),this}dispatchDirection(t){return this.dispatchDirection=t,this}dispatchToComponent(t){return this.dispatchToComponent=t,this}event(t){return this.event=t,this}eventData(t){return this.eventData=t,this}extraAttributes(t){return this.extraAttributes=t,this}icon(t){return this.icon=t,this}iconPosition(t){return this.iconPosition=t,this}outlined(t=!0){return this.isOutlined=t,this}disabled(t=!0){return this.isDisabled=t,this}label(t){return this.label=t,this}close(t=!0){return this.shouldClose=t,this}openUrlInNewTab(t=!0){return this.shouldOpenUrlInNewTab=t,this}size(t){return this.size=t,this}url(t){return this.url=t,this}view(t){return this.view=t,this}button(){return this.view("filament-notifications::actions.button-action"),this}grouped(){return this.view("filament-notifications::actions.grouped-action"),this}link(){return this.view("filament-notifications::actions.link-action"),this}},w=class{constructor(t){return this.actions(t),this}actions(t){return this.actions=t.map(i=>i.grouped()),this}color(t){return this.color=t,this}icon(t){return this.icon=t,this}iconPosition(t){return this.iconPosition=t,this}label(t){return this.label=t,this}tooltip(t){return this.tooltip=t,this}};window.FilamentNotificationAction=g;window.FilamentNotificationActionGroup=w;window.FilamentNotification=m;document.addEventListener("alpine:init",()=>{window.Alpine.plugin(U)});})();
2 |
--------------------------------------------------------------------------------
/public/js/filament/support/async-alpine.js:
--------------------------------------------------------------------------------
1 | (()=>{var l=t=>new Promise(e=>{window.addEventListener("async-alpine:load",n=>{n.detail.id===t.id&&e()})}),d=l,h=()=>new Promise(t=>{"requestIdleCallback"in window?window.requestIdleCallback(t):setTimeout(t,200)}),p=h,_=t=>new Promise(e=>{let n=t.indexOf("("),i=t.slice(n),s=window.matchMedia(i);s.matches?e():s.addEventListener("change",e,{once:!0})}),u=_,c=(t,e)=>new Promise(n=>{let i="0px 0px 0px 0px";if(e.indexOf("(")!==-1){let a=e.indexOf("(")+1;i=e.slice(a,-1)}let s=new IntersectionObserver(a=>{a[0].isIntersecting&&(s.disconnect(),n())},{rootMargin:i});s.observe(t.el)}),f=c,r="__internal_",o={Alpine:null,_options:{prefix:"ax-",alpinePrefix:"x-",root:"load",inline:"load-src",defaultStrategy:"immediate"},_alias:!1,_data:{},_realIndex:0,get _index(){return this._realIndex++},init(t,e={}){return this.Alpine=t,this._options={...this._options,...e},this},start(){return this._processInline(),this._setupComponents(),this._mutations(),this},data(t,e=!1){return this._data[t]={loaded:!1,download:e},this},url(t,e){!t||!e||(this._data[t]||this.data(t),this._data[t].download=()=>import(this._parseUrl(e)))},alias(t){this._alias=t},_processInline(){let t=document.querySelectorAll(`[${this._options.prefix}${this._options.inline}]`);for(let e of t)this._inlineElement(e)},_inlineElement(t){let e=t.getAttribute(`${this._options.alpinePrefix}data`),n=t.getAttribute(`${this._options.prefix}${this._options.inline}`);if(!e||!n)return;let i=this._parseName(e);this.url(i,n)},_setupComponents(){let t=document.querySelectorAll(`[${this._options.prefix}${this._options.root}]`);for(let e of t)this._setupComponent(e)},_setupComponent(t){let e=t.getAttribute(`${this._options.alpinePrefix}data`);t.setAttribute(`${this._options.alpinePrefix}ignore`,"");let n=this._parseName(e),i=t.getAttribute(`${this._options.prefix}${this._options.root}`)||this._options.defaultStrategy;this._componentStrategy({name:n,strategy:i,el:t,id:t.id||this._index})},async _componentStrategy(t){let e=t.strategy.split("|").map(i=>i.trim()).filter(i=>i!=="immediate").filter(i=>i!=="eager");if(!e.length){await this._download(t.name),this._activate(t);return}let n=[];for(let i of e){if(i==="idle"){n.push(p());continue}if(i.startsWith("visible")){n.push(f(t,i));continue}if(i.startsWith("media")){n.push(u(i));continue}i==="event"&&n.push(d(t))}Promise.all(n).then(async()=>{await this._download(t.name),this._activate(t)})},async _download(t){if(t.startsWith(r)||(this._handleAlias(t),!this._data[t]||this._data[t].loaded))return;let e=await this._getModule(t);this.Alpine.data(t,e),this._data[t].loaded=!0},async _getModule(t){if(!this._data[t])return;let e=await this._data[t].download();return typeof e=="function"?e:e[t]||e.default||Object.values(e)[0]||!1},_activate(t){t.el.removeAttribute(`${this._options.alpinePrefix}ignore`),t.el._x_ignore=!1,this.Alpine.initTree(t.el)},_mutations(){new MutationObserver(t=>{for(let e of t)if(e.addedNodes)for(let n of e.addedNodes)n.nodeType===1&&(n.hasAttribute(`${this._options.prefix}${this._options.root}`)&&this._mutationEl(n),n.querySelectorAll(`[${this._options.prefix}${this._options.root}]`).forEach(i=>this._mutationEl(i)))}).observe(document,{attributes:!0,childList:!0,subtree:!0})},_mutationEl(t){t.hasAttribute(`${this._options.prefix}${this._options.inline}`)&&this._inlineElement(t),this._setupComponent(t)},_handleAlias(t){!this._alias||this._data[t]||this.url(t,this._alias.replace("[name]",t))},_parseName(t){return(t||"").split(/[({]/g)[0]||`${r}${this._index}`},_parseUrl(t){return new RegExp("^(?:[a-z+]+:)?//","i").test(t)?t:new URL(t,document.baseURI).href}};document.addEventListener("alpine:init",()=>{window.AsyncAlpine=o,o.init(Alpine,window.AsyncAlpineOptions||{}),document.dispatchEvent(new CustomEvent("async-alpine:init")),o.start()});})();
2 |
--------------------------------------------------------------------------------
/public/js/filament/tables/tables.js:
--------------------------------------------------------------------------------
1 | (()=>{})();
2 |
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Disallow:
3 |
--------------------------------------------------------------------------------
/resources/css/app.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codewithdary/hostinger-filament/e6d09f8675bdad5a0ab37f71e1baba135aa36617/resources/css/app.css
--------------------------------------------------------------------------------
/resources/js/app.js:
--------------------------------------------------------------------------------
1 | import './bootstrap';
2 |
--------------------------------------------------------------------------------
/resources/js/bootstrap.js:
--------------------------------------------------------------------------------
1 | /**
2 | * We'll load the axios HTTP library which allows us to easily issue requests
3 | * to our Laravel back-end. This library automatically handles sending the
4 | * CSRF token as a header based on the value of the "XSRF" token cookie.
5 | */
6 |
7 | import axios from 'axios';
8 | window.axios = axios;
9 |
10 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
11 |
12 | /**
13 | * Echo exposes an expressive API for subscribing to channels and listening
14 | * for events that are broadcast by Laravel. Echo and event broadcasting
15 | * allows your team to easily build robust real-time web applications.
16 | */
17 |
18 | // import Echo from 'laravel-echo';
19 |
20 | // import Pusher from 'pusher-js';
21 | // window.Pusher = Pusher;
22 |
23 | // window.Echo = new Echo({
24 | // broadcaster: 'pusher',
25 | // key: import.meta.env.VITE_PUSHER_APP_KEY,
26 | // cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER ?? 'mt1',
27 | // wsHost: import.meta.env.VITE_PUSHER_HOST ? import.meta.env.VITE_PUSHER_HOST : `ws-${import.meta.env.VITE_PUSHER_APP_CLUSTER}.pusher.com`,
28 | // wsPort: import.meta.env.VITE_PUSHER_PORT ?? 80,
29 | // wssPort: import.meta.env.VITE_PUSHER_PORT ?? 443,
30 | // forceTLS: (import.meta.env.VITE_PUSHER_SCHEME ?? 'https') === 'https',
31 | // enabledTransports: ['ws', 'wss'],
32 | // });
33 |
--------------------------------------------------------------------------------
/resources/views/vendor/filament-panels/components/logo.blade.php:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/routes/api.php:
--------------------------------------------------------------------------------
1 | get('/user', function (Request $request) {
18 | return $request->user();
19 | });
20 |
--------------------------------------------------------------------------------
/routes/channels.php:
--------------------------------------------------------------------------------
1 | id === (int) $id;
18 | });
19 |
--------------------------------------------------------------------------------
/routes/console.php:
--------------------------------------------------------------------------------
1 | comment(Inspiring::quote());
19 | })->purpose('Display an inspiring quote');
20 |
--------------------------------------------------------------------------------
/routes/web.php:
--------------------------------------------------------------------------------
1 | make(Kernel::class)->bootstrap();
18 |
19 | return $app;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/tests/Feature/ExampleTest.php:
--------------------------------------------------------------------------------
1 | get('/');
16 |
17 | $response->assertStatus(200);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/tests/TestCase.php:
--------------------------------------------------------------------------------
1 | assertTrue(true);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/vite.config.js:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vite';
2 | import laravel from 'laravel-vite-plugin';
3 |
4 | export default defineConfig({
5 | plugins: [
6 | laravel({
7 | input: ['resources/css/app.css', 'resources/js/app.js'],
8 | refresh: true,
9 | }),
10 | ],
11 | });
12 |
--------------------------------------------------------------------------------