Skip to content

Commit

Permalink
Make model configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-ro committed Jun 5, 2024
1 parent c0f3957 commit 6cdc406
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ SeoRobots::make()
php artisan filament-seo-meta-tags:publish-middleware
```


In your `app/Http/Kernel.php` file, add the middleware to the `web` group:

```php
Expand All @@ -72,6 +71,12 @@ protected $middlewareGroups = [
];
```

## Publishing the configuration

```bash
php artisan vendor:publish --tag=filament-seo-meta-tags-config
```

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
5 changes: 5 additions & 0 deletions config/filament-seo-meta-tags.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

return [
'model' => \MartinRo\FilamentSeoMetaTags\Models\SeoMetaTag::class,
];
2 changes: 1 addition & 1 deletion src/Concerns/HasSeoMetaTags.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ public function setSeoMetaTags(): void

public function seoMetaTags(): MorphOne
{
return $this->morphOne(SeoMetaTag::class, 'model');
return $this->morphOne(config('filament-seo-meta-tags.model', SeoMetaTag::class), 'model');
}
}
1 change: 1 addition & 0 deletions src/FilamentSeoMetaTagsServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public function configurePackage(Package $package): void
$package->name(static::$name)
->hasMigration('create_seo_meta_tags_table')
->runsMigrations()
->hasConfigFile()
->hasCommands([
Commands\PublishMiddleware::class,
]);
Expand Down

0 comments on commit 6cdc406

Please sign in to comment.