Skip to content

Class 'Activation' not found #537

@Qrzysio

Description

@Qrzysio

Sentinel works well with Laravel, but it has some traps when it comes to the native implementation.

Let's try creating an activation.

$user = Sentinel::findById(1);
$activation = Activation::create($user);

The above throws Class 'Activation' not found error.

It seems to be undocumented and consumes quite a lot of time to solve the problem out. Thanks to the only one post on StackOverflow.om I've found the solution.

This is because the Activation class provided with Sentinel is only supported by Laravel directly not the Native Laravel/Database library for some strange reason.
You can get the Activation Repository for Native by replacing...
Activation:: with Sentinel::getActivationRepository()

So the solution is:

$user = Sentinel::findById(1);
$activation = Sentinel::getActivationRepository();

Unfortunately, there is nothing about that in docs. Consider adding a bit more info about native implementation, please.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions