- What is overtrue/laravel-follow used for?
- It adds user-based follow and unfollow functionality to Laravel models. You can let users follow other users or models and check relationships through a trait-based API. It supports followers, following lists, and follow-state queries.
- How do I install overtrue/laravel-follow?
- Install it with Composer using composer require overtrue/laravel-follow. Laravel package discovery registers the service provider automatically. Add the package traits to your models and follow the README for any migration or configuration steps. Version 6.0.0 requires Laravel 13+ and PHP 8.3+.
- Which Laravel versions does overtrue/laravel-follow 6.0 support?
- Version 6.0.0 supports Laravel 13+ only and requires PHP 8.3 or newer. It will not install on Laravel 11 or 12 because the framework constraint is a hard floor. Use the 5.x line if your application is on an older Laravel version.
- How do I make a model followable or a follower?
- Add the package's traits to the model that performs follows and to the models that can be followed. Then call the provided follow and unfollow methods to create or remove relationships. This keeps follow logic inside your Eloquent models.
- How can I check if a user is following another user?
- Use the package's follow-state query methods on the follower model to check whether one model follows another. The trait wraps the relationship logic so you do not need custom pivot queries. Check the README for the exact method names in your installed version.
- Can I get a list of followers and following users?
- Yes. The package exposes followers and following lists through its trait relationships. You can use those relationships in controllers, API resources, or queries. Eager load them when returning lists to avoid N+1 queries.
- Does overtrue/laravel-follow work with Laravel 12 or PHP 8.2?
- No. Version 6.0.0 requires Laravel 13+ and PHP 8.3+, and Composer will block installation on Laravel 12 or PHP 8.2. There is no supported mixed configuration. Stay on the package's 5.x line until you upgrade the host application.
- Is overtrue/laravel-follow production ready and maintained?
- It is a Composer-distributed Laravel package with a testbench and PHPUnit test harness. The 6.0.0 release is aligned to Laravel 13 and indicates that package majors track Laravel majors. Confirm the support and EOL policy for older lines in the repository before relying on 5.x long term.
- What are the breaking changes in overtrue/laravel-follow 6.0?
- The 6.0.0 release notes list Laravel 13+ and PHP 8.3+ requirements plus test and tooling updates. They do not document API or behavioral breaking changes. Diff the code or read the upgrade guide before upgrading. Treat it as a platform realignment until you confirm otherwise.
- How do I test follow relationships in my Laravel app?
- Write feature tests that call follow and unfollow on your models and assert the resulting follow state. You can use Laravel's testing helpers with a test database or testbench-style setup. Mirror the package's PHPUnit and testbench harness if you need package-level tests.