lelectrolux/content-links

Search for links in your models content, and check them for errors

1.0.0 2025-06-14 23:12 UTC

This package is auto-updated.

Last update: 2025-06-14 23:17:21 UTC


README

Search for links in your models content, and check them for errors

Getting Started

First, publish the config and migration files

php artisan vendor:publish --provider=Lelectrolux\ContentLinks\ContentLinksServiceProvider

Then, run the migration

php artisan migrate

Then, for each relevant model:

  • Add 2 imports
use \Lelectrolux\ContentLinks\Contracts\HasContentLinks as HasContentLinksContract;
use \Lelectrolux\ContentLinks\Models\HasContentLinks;
  • Implement HasContentLinksContract
  • Use HasContentLinks

Finally, add all the models ::class to the content-links.models config key

Optionally, add the commands to your scheduler

Available commands

# \Lelectrolux\ContentLinks\Console\Commands\ContentLinksCheck
# php artisan content-links:check {class?*} {--all}
php artisan content-links:check --all
php artisan content-links:check App\Models\MyModel
php artisan content-links:check App\Models\MyModel:1,2,3
php artisan content-links:check App\Models\MyModel:1,2,3 App\Models\MyOtherModel:1,2,3
# \Lelectrolux\ContentLinks\Console\Commands\ContentLinksPurge
php artisan content-links:purge

Export