Skip to content
Discussion options

You must be logged in to vote

While planning to submit a PR to implement this, I did eventually find a way to do this using Laravel's service container!

You can extend Statamics EntriesController and override the indexQuery method. In there, you can add your own queries:

use Statamic\Facades\User;
use Statamic\Http\Controllers\CP\Collections\EntriesController;

class FilteringAuthorEntriesController extends EntriesController
{
    protected function indexQuery($collection)
    {
        return parent::indexQuery($collection)
            ->where('author', User::current()->id());
    }
}

After that, you need to replace the original EntriesController with your own FilteringAuthorEntriesController in a service provider:

p…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@fjahn
Comment options

@velasco
Comment options

Comment options

You must be logged in to vote
1 reply
@edalzell
Comment options

Answer selected by joshuablum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants