Skip to content

Commit 1c9c5a8

Browse files
committed
Slug wip
1 parent 564b389 commit 1c9c5a8

File tree

25 files changed

+857
-14
lines changed

25 files changed

+857
-14
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace App\Builder\Plugins;
6+
7+
use App\Builder\Resources\SoftDeleteItemResource;
8+
use Filament\Contracts\Plugin;
9+
use Filament\Panel;
10+
use Filament\Support\Concerns\EvaluatesClosures;
11+
12+
class SoftDeleteItemPlugin implements Plugin
13+
{
14+
use EvaluatesClosures;
15+
16+
public function getId(): string
17+
{
18+
return 'soft-delete-item';
19+
}
20+
21+
public function register(Panel $panel): void
22+
{
23+
$panel->resources([
24+
SoftDeleteItemResource::class,
25+
]);
26+
}
27+
28+
public function boot(Panel $panel): void
29+
{
30+
//
31+
}
32+
33+
public static function make(): static
34+
{
35+
return app(static::class);
36+
}
37+
}

app/Builder/Resources/SoftDeleteItemResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace App\Builder\Resources;
66

77
use App\Builder\Resources\SoftDeleteItemResource\Pages;
8-
use Camya\Filament\Forms\Components\TitleWithSlugInput;
98
use Filament\Forms\Components\Grid;
109
use Filament\Forms\Components\Section;
1110
use Filament\Forms\Components\Select;
@@ -22,6 +21,7 @@
2221
use Moox\Core\Traits\SoftDelete\SingleSoftDeleteInResource;
2322
use Moox\Core\Traits\Tabs\HasResourceTabs;
2423
use Moox\Core\Traits\Taxonomy\HasResourceTaxonomy;
24+
use Moox\Slug\Forms\Components\TitleWithSlugInput;
2525

2626
class SoftDeleteItemResource extends Resource
2727
{

app/Providers/Filament/AdminPanelProvider.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ public function panel(Panel $panel): Panel
133133
StaticLanguagePlugin::make(),
134134
StaticTimezonePlugin::make(),
135135
StaticCurrencyPlugin::make(),
136+
137+
// SoftDeleteItemPlugin::make(),
136138
]);
137139
}
138140
}

packages/data/src/Filament/Resources/StaticLanguageResource.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,7 @@ public static function table(Table $table): Table
122122
IconColumn::make('alpha2')
123123
->label('')
124124
->icon(fn (string $state): ?string => @file_exists(base_path("packages/flag-icons-circle/resources/svg/{$state}.svg")) ? "flag-{$state}" : null),
125-
// TextColumn::make('alpha2')
126-
// ->label('Alpha-2'),
127-
TextColumn::make('alpha2_test')
125+
TextColumn::make('alpha2_')
128126
->label('Alpha-2')
129127
->getStateUsing(fn ($record) => $record->alpha2),
130128
TextColumn::make('alpha3_b')

packages/flag-icons-square/config/flag-icons-square.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
|
3838
*/
3939

40-
'class' => 'rounded-lg w-auto h-auto',
40+
'class' => 'rounded-lg',
4141

4242
/*
4343
|-----------------------------------------------------------------

packages/slug/composer.json

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
},
2222
"autoload": {
2323
"psr-4": {
24-
"Moox\\Slug\\": "src",
25-
"Moox\\Slug\\Database\\Factories\\": "database/factories"
24+
"Moox\\Slug\\": "src"
2625
}
2726
},
2827
"extra": {
@@ -43,11 +42,7 @@
4342
},
4443
"autoload-dev": {
4544
"psr-4": {
46-
"Moox\\Slug\\Tests\\": "tests",
47-
"Moox\\Slug\\Database\\Factories\\": "database/factories",
48-
"Workbench\\App\\": "workbench/app/",
49-
"Workbench\\Database\\Factories\\": "workbench/database/factories/",
50-
"Workbench\\Database\\Seeders\\": "workbench/database/seeders/"
45+
"Moox\\Slug\\Tests\\": "tests"
5146
}
5247
},
5348
"scripts": {
@@ -75,4 +70,4 @@
7570
"pestphp/pest-plugin": true
7671
}
7772
}
78-
}
73+
}

packages/slug/config/slug.php

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,30 @@
1515
|
1616
*/
1717

18-
return [];
18+
return [
19+
20+
/*
21+
|--------------------------------------------------------------------------
22+
| Model Fields
23+
|--------------------------------------------------------------------------
24+
|
25+
| The names of the fields in your model where the title and slug are stored.
26+
|
27+
| Overridable like: TitleWithSlugInput::make(fieldTitle: 'title')
28+
|
29+
*/
30+
31+
'field_title' => 'title', // Overridable with parameter (fieldTitle: 'title')
32+
'field_slug' => 'slug', // Overridable with parameter (fieldSlug: 'title')
33+
34+
/*
35+
|--------------------------------------------------------------------------
36+
| Url
37+
|--------------------------------------------------------------------------
38+
|
39+
| URL related config values.
40+
|
41+
*/
42+
43+
'url_host' => env('APP_URL'), // Overridable with parameter (urlHost: 'https://www.moox.org/')
44+
];

packages/slug/package.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"private": true,
3+
"description": "TitleWithSlugInput - Easy Permalink Slugs for the FilamentPHP Form Builder (PHP / Laravel / Livewire)",
4+
"scripts": {
5+
"dev": "npx tailwindcss -i ./resources/css/filament-title-with-slug.css -o ./resources/dist/filament-title-with-slug.css --postcss --watch",
6+
"build": "npx tailwindcss -i ./resources/css/filament-title-with-slug.css -o ./resources/dist/filament-title-with-slug.css --postcss --minify && npm run purge",
7+
"purge": "filament-purge -i ./resources/dist/filament-title-with-slug.css -o ./resources/dist/filament-title-with-slug.css"
8+
},
9+
"author": "Andreas Scheibel",
10+
"license": "MIT",
11+
"devDependencies": {
12+
"@awcodes/filament-plugin-purge": "^1.0.1",
13+
"autoprefixer": "^10.4.7",
14+
"postcss": "^8.4.14",
15+
"tailwindcss": "^3.1.2"
16+
}
17+
}

packages/slug/pint.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"preset": "laravel"
3+
}

packages/slug/postcss.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
};

0 commit comments

Comments
 (0)