Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class 'Activation' not found #537

Open
Qrzysio opened this issue Aug 23, 2020 · 0 comments
Open

Class 'Activation' not found #537

Qrzysio opened this issue Aug 23, 2020 · 0 comments

Comments

@Qrzysio
Copy link

Qrzysio commented Aug 23, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant