Skip to content

Commit 525610d

Browse files
authored
Upgrade to Filament v5 (#29)
* Upgrade to Filament v5 * Update namespace to wotz * Fix styling --------- Co-authored-by: jyrkidn <2447042+jyrkidn@users.noreply.github.com>
1 parent b2b19a0 commit 525610d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+181
-183
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
blank_issues_enabled: false
22
contact_links:
33
- name: Feature request
4-
url: https://github.com/codedor/filament-seo/discussions/new?category=ideas
4+
url: https://github.com/wotzebra/filament-seo/discussions/new?category=ideas
55
about: Share ideas for new features
66
- name: Support question
7-
url: https://github.com/codedor/filament-seo/discussions/new?category=q-a
7+
url: https://github.com/wotzebra/filament-seo/discussions/new?category=q-a
88
about: Ask the community for help
99
- name: Report a security issue
10-
url: https://github.com/codedor/filament-seo/README.md#security
10+
url: https://github.com/wotzebra/filament-seo/README.md#security
1111
about: Learn how to notify us for sensitive bugs
1212
- name: Report a bug
13-
url: https://github.com/codedor/filament-seo/issues/new
13+
url: https://github.com/wotzebra/filament-seo/issues/new
1414
about: Report a reproducable bug

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 Code d'Or
3+
Copyright (c) 2022 Who Owns The Zebra
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ enhance your website's SEO capabilities and drive more organic traffic to your s
1212
You can install the package via composer:
1313

1414
```bash
15-
composer require codedor/filament-seo
15+
composer require wotz/filament-seo
1616
```
1717

1818
You can publish and run the migrations with:
@@ -31,15 +31,14 @@ php artisan vendor:publish --tag="filament-seo-config"
3131
This is the contents of the published config file:
3232

3333
```php
34-
use Codedor\Seo\Tags\Meta;
35-
use Codedor\Seo\Tags\OgUrl;
36-
use Codedor\Seo\Tags\OpenGraph;
37-
use Codedor\Seo\Tags\OpenGraphImage;
34+
use Wotz\Seo\Tags\Meta;
35+
use Wotz\Seo\Tags\OgUrl;
36+
use Wotz\Seo\Tags\OpenGraph;
37+
use Wotz\Seo\Tags\OpenGraphImage;
3838

39-
// config for Codedor/Seo
4039
return [
4140
'models' => [
42-
'seo-route' => \Codedor\Seo\Models\SeoRoute::class,
41+
'seo-route' => \Wotz\Seo\Models\SeoRoute::class,
4342
],
4443
'default' => [
4544
'title_og' => [
@@ -85,7 +84,7 @@ return [
8584

8685
```php
8786
// Filament
88-
\Codedor\Seo\Filament\SeoCard::make();
87+
\Wotz\Seo\Filament\SeoCard::make();
8988

9089
// Front-end
9190
@seo()

UPGRADING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# Upgrading
22

3-
## From vx to vy
3+
## From v2 to v3
4+
- Install `wotz/filament-seo` instead of `codedor/filament-seo`
5+
- Replace all occurrences of `Codedor\Seo` namespace with new `Wotz\Seo` namespace

composer.json

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,49 @@
11
{
2-
"name": "codedor/filament-seo",
2+
"name": "wotz/filament-seo",
33
"description": "Package to manage SEO tags for models and routes in Filament",
44
"keywords": [
5-
"codedor",
5+
"who owns the zebra",
66
"laravel",
77
"filament-seo"
88
],
9-
"homepage": "https://github.com/codedor/filament-seo",
9+
"homepage": "https://github.com/wotzebra/filament-seo",
1010
"license": "MIT",
1111
"require": {
1212
"php": "^8.2",
13-
"codedor/filament-media-library": "dev-feature/filament-v4",
14-
"codedor/filament-translatable-tabs": "dev-feature/filament-v4",
15-
"codedor/laravel-locale-collection": "^1.2",
16-
"filament/filament": "^4.0",
13+
"filament/filament": "^4.0|^5.0",
1714
"illuminate/contracts": "^10.0|^11.0|^12.0",
1815
"spatie/laravel-package-tools": "^1.12",
19-
"spatie/laravel-translatable": "^6.5"
16+
"spatie/laravel-translatable": "^6.5",
17+
"wotz/filament-media-library": "^4.0",
18+
"wotz/filament-translatable-tabs": "^2.0",
19+
"wotz/laravel-locale-collection": "^2.0"
2020
},
2121
"require-dev": {
22-
"filament/upgrade": "^4.0",
2322
"larastan/larastan": "^2.0|^3.0",
2423
"laravel/pint": "^1.0",
2524
"nunomaduro/collision": "^7.0|^8.0",
2625
"orchestra/testbench": "^8.0|^9.0|^10.0",
27-
"pestphp/pest": "^2.0|^3.0",
28-
"pestphp/pest-plugin-laravel": "^2.0|^3.0",
26+
"pestphp/pest": "^2.0|^3.0|^4.0",
27+
"pestphp/pest-plugin-laravel": "^2.0|^3.0|^4.0",
2928
"phpstan/extension-installer": "^1.1|^2.0",
3029
"phpstan/phpstan-deprecation-rules": "^1.0|^2.0",
3130
"phpstan/phpstan-phpunit": "^1.0|^2.0"
3231
},
3332
"autoload": {
3433
"psr-4": {
35-
"Codedor\\Seo\\": "src",
36-
"Codedor\\Seo\\Database\\Factories\\": "database/factories"
34+
"Wotz\\Seo\\": "src",
35+
"Wotz\\Seo\\Database\\Factories\\": "database/factories"
3736
}
3837
},
3938
"autoload-dev": {
4039
"psr-4": {
41-
"Codedor\\Seo\\Tests\\": "tests"
40+
"Wotz\\Seo\\Tests\\": "tests"
4241
}
4342
},
4443
"extra": {
4544
"laravel": {
4645
"providers": [
47-
"Codedor\\Seo\\Providers\\SeoServiceProvider"
46+
"Wotz\\Seo\\Providers\\SeoServiceProvider"
4847
]
4948
}
5049
},

config/filament-seo.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
<?php
22

3-
use Codedor\Seo\Tags\Meta;
4-
use Codedor\Seo\Tags\OgUrl;
5-
use Codedor\Seo\Tags\OpenGraph;
6-
use Codedor\Seo\Tags\OpenGraphImage;
3+
use Wotz\Seo\Tags\Meta;
4+
use Wotz\Seo\Tags\OgUrl;
5+
use Wotz\Seo\Tags\OpenGraph;
6+
use Wotz\Seo\Tags\OpenGraphImage;
77

8-
// config for Codedor/Seo
98
return [
109
'models' => [
11-
'seo-route' => \Codedor\Seo\Models\SeoRoute::class,
10+
'seo-route' => \Wotz\Seo\Models\SeoRoute::class,
1211
],
1312
'default' => [
1413
'title_og' => [

database/factories/ModelFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Codedor\Seo\Database\Factories;
3+
namespace Wotz\Seo\Database\Factories;
44

55
use Illuminate\Database\Eloquent\Factories\Factory;
66

docs/index.md

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ enhance your website's SEO capabilities and drive more organic traffic to your s
1515
You can install the package via composer:
1616

1717
```bash
18-
composer require codedor/filament-seo
18+
composer require wotz/filament-seo
1919
```
2020

2121
You can publish and run the migrations with:
@@ -34,15 +34,14 @@ php artisan vendor:publish --tag="filament-seo-config"
3434
This is the contents of the published config file:
3535

3636
```php
37-
use Codedor\Seo\Tags\Meta;
38-
use Codedor\Seo\Tags\OgUrl;
39-
use Codedor\Seo\Tags\OpenGraph;
40-
use Codedor\Seo\Tags\OpenGraphImage;
37+
use Wotz\Seo\Tags\Meta;
38+
use Wotz\Seo\Tags\OgUrl;
39+
use Wotz\Seo\Tags\OpenGraph;
40+
use Wotz\Seo\Tags\OpenGraphImage;
4141

42-
// config for Codedor/Seo
4342
return [
4443
'models' => [
45-
'seo-route' => \Codedor\Seo\Models\SeoRoute::class,
44+
'seo-route' => \Wotz\Seo\Models\SeoRoute::class,
4645
],
4746
'default' => [
4847
'title_og' => [
@@ -93,20 +92,20 @@ To add SEO tags to your model, you need to use the `HasSeoFields` trait and add
9392
```php
9493
public function getSeoTags(): SeoTags
9594
{
96-
return \Codedor\Seo\SeoTags::make()
97-
->add(\Codedor\Seo\Tags\Meta::make($this, 'title', 'title')->translatable())
95+
return \Wotz\Seo\SeoTags::make()
96+
->add(\Wotz\Seo\Tags\Meta::make($this, 'title', 'title')->translatable())
9897
->add(
99-
\Codedor\Seo\Tags\OpenGraph::make(
98+
\Wotz\Seo\Tags\OpenGraph::make(
10099
$this,
101100
'title',
102101
function (string $locale) {
103102
return $this->working_title . ' ' . $locale;
104103
}
105104
)->translatable()
106105
)
107-
->add(\Codedor\Seo\Tags\Meta::make($this, 'description', 'intro')->translatable())
108-
->add(\Codedor\Seo\Tags\OpenGraph::make($this, 'description', fn (string $locale) => 'og description ' . $locale)->translatable())
109-
->add(\Codedor\Seo\Tags\OpenGraphImage::make($this, 'image', fn () => $this->attachment_id));
106+
->add(\Wotz\Seo\Tags\Meta::make($this, 'description', 'intro')->translatable())
107+
->add(\Wotz\Seo\Tags\OpenGraph::make($this, 'description', fn (string $locale) => 'og description ' . $locale)->translatable())
108+
->add(\Wotz\Seo\Tags\OpenGraphImage::make($this, 'image', fn () => $this->attachment_id));
110109
}
111110
```
112111

@@ -121,15 +120,15 @@ public static function form(Form $form): Form
121120
{
122121
return $form->schema([
123122
// ...
124-
\Codedor\Seo\Filament\SeoCard::make(static::getModel()),
123+
\Wotz\Seo\Filament\SeoCard::make(static::getModel()),
125124
// ...
126125
]);
127126
}
128127
```
129128

130129
Since tags are translatable (we use [`spatie/laravel-translatable`](https://spatie.be/docs/laravel-translatable/v6/introduction) for this) you can also pass a locale to the SeoCard.
131130

132-
E.g. if you work with our [Translatable Tabs](https://github.com/codedor/filament-translatable-tabs) package:
131+
E.g. if you work with our [Translatable Tabs](https://github.com/wotzebra/filament-translatable-tabs) package:
133132

134133
```php
135134
public static function form(Form $form): Form
@@ -151,17 +150,17 @@ public static function form(Form $form): Form
151150
}
152151
```
153152

154-
Next to that you also have to add the `\Codedor\Seo\Filament\Traits\SavesSeoFields` trait to your Create and Edit Page for this resource.
153+
Next to that you also have to add the `\Wotz\Seo\Filament\Traits\SavesSeoFields` trait to your Create and Edit Page for this resource.
155154
We need this since we have to modify the state before saving it.
156155

157156
### Routes
158157

159-
To make your routes pop up in the Seo Routes module in Filament, you have to attach the `\Codedor\Seo\Http\Middleware\SeoMiddleware` middleware.
158+
To make your routes pop up in the Seo Routes module in Filament, you have to attach the `\Wotz\Seo\Http\Middleware\SeoMiddleware` middleware.
160159

161160
```php
162161
Route::get('/', HomeController::class)
163162
->name('home')
164-
->middleware(\Codedor\Seo\Http\Middleware\SeoMiddleware::class);
163+
->middleware(\Wotz\Seo\Http\Middleware\SeoMiddleware::class);
165164
```
166165

167166
Then run the `php artisan seo:import` command to add the routes to the database.
@@ -191,10 +190,10 @@ It will first look on the model, then the routes and then the default config to
191190

192191
Default we have support for the following tags:
193192

194-
- `Codedor\Seo\Tags\Meta`
195-
- `Codedor\Seo\Tags\OpenGraph`
196-
- `Codedor\Seo\Tags\OpenGraphImage`
197-
- `Codedor\Seo\Tags\OgUrl`
193+
- `Wotz\Seo\Tags\Meta`
194+
- `Wotz\Seo\Tags\OpenGraph`
195+
- `Wotz\Seo\Tags\OpenGraphImage`
196+
- `Wotz\Seo\Tags\OgUrl`
198197

199198
These all extend the BaseTag class and implement the Tag interface.
200199

@@ -203,7 +202,7 @@ So to add your own tag, just create a class that extends the BaseTag class and i
203202
```php
204203
<?php
205204

206-
namespace Codedor\Seo\Tags;
205+
namespace Wotz\Seo\Tags;
207206

208207
class CustomImplementation extends BaseTag
209208
{

src/Console/Commands/ImportSeoRoutes.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22

3-
namespace Codedor\Seo\Console\Commands;
3+
namespace Wotz\Seo\Console\Commands;
44

5-
use Codedor\Seo\SeoRoutes;
65
use Illuminate\Console\Command;
6+
use Wotz\Seo\SeoRoutes;
77

88
class ImportSeoRoutes extends Command
99
{

src/Facades/SeoBuilder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<?php
22

3-
namespace Codedor\Seo\Facades;
3+
namespace Wotz\Seo\Facades;
44

55
use Illuminate\Support\Collection;
66
use Illuminate\Support\Facades\Facade;
77

88
/**
9-
* @method static void tag(\Codedor\Seo\Tags\Tag $item)
9+
* @method static void tag(\Wotz\Seo\Tags\Tag $item)
1010
* @method static void tags(array $items, bool $overwrite = true)
1111
* @method static string render()
1212
* @method static Collection contents()
1313
* @method static object getTags()
1414
* @method static string getTag(string $tagName)
1515
*
16-
* @see \Codedor\Seo\SeoBuilder
16+
* @see \Wotz\Seo\SeoBuilder
1717
*/
1818
class SeoBuilder extends Facade
1919
{

0 commit comments

Comments
 (0)