sort of installed Sentinel ( i say sort of because I dont understand one part that says:
Sentinel ships with default implementations for illuminate/database, in order to use it, make sure you require it on your composer.json file.
// Import the necessary classes
use Cartalyst\Sentinel\Native\Facades\Sentinel;
use Illuminate\Database\Capsule\Manager as Capsule;
// Include the composer autoload file
require 'vendor/autoload.php';
Question 1: where do I write that code ?
Question 2:, what I care most now is how to make something out of this, regarding Registration, Activation etc. I would have expected to have a link created that is sent to your email and upon clicking on it you activate it. But all I can see it says is this:
$credentials = [
'email' => 'john.doe@example.com',
'password' => 'password',
];
$user = Sentinel::register($credentials);
or if Also activate:
$credentials = [
'email' => 'john.doe@example.com',
'password' => 'password',
];
$user = Sentinel::registerAndActivate($credentials);
I am supposed to write that in the Controller when I get the input ? and what about the email activation ?
The following code:
use Cartalyst\Sentinel\Native\Facades\Sentinel;
use Illuminate\Database\Capsule\Manager as Capsule;
Is for people trying to use the package natively. Since you are using laravel, you don't need this. Please make sure you follow the laravel-specific instructions.
Because You've tagged laravel-5
in your question, I'm assuming that this is what you are using. In that case, first add this to your composer.json:
composer require cartalyst/sentinel "2.0.*"
and the following to your config/app.php file:
To the $providers
array:
'Cartalyst\Sentinel\Laravel\SentinelServiceProvider',
And to the $alias~ array
:
'Activation' => 'Cartalyst\Sentinel\Laravel\Facades\Activation',
'Reminder' => 'Cartalyst\Sentinel\Laravel\Facades\Reminder',
'Sentinel' => 'Cartalyst\Sentinel\Laravel\Facades\Sentinel',
Once you've done this, you can publish and migrate the package. You will also need to extendend Cartalyst\Sentinel\Users\EloquentUser
on your user model instead of Eloquent. You will need to do the same if you are using a "roles" model.
For more information, follow the documentation: https://cartalyst.com/manual/sentinel/2.0#laravel-5
make sure you are on the correct version: 2.0 for Laravel 5 and 1.0 for laravel 4.*
In regards to your second question, you will have to send an e-mail to the client with the activation code (usually the code is hidden as a query string or something, so the user don't necessarily need to have knowledge of it) and than you do the activation using the code. Or if you prefer you can authenticate automatically once they sign up.
Read more upon activation on their documentation, if you still can't figure out we are here to help, but try for yourself first.