PHP code example of rosalana / accounts

1. Go to this page and download the library: Download rosalana/accounts library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

rosalana / accounts example snippets


use Rosalana\Accounts\Facades\Accounts;

$user = Accounts::login([
    'email' => '[email protected]',
    'password' => 'secret',
]);

$user = Accounts::register([
    'name' => 'John Doe',
    'email' => '[email protected]',
    'password' => 'secret',
]);

Accounts::logout();

Accounts::refresh();

auth()->user();

// Get the currently stored Basecamp token
$token = Accounts::token()->get();

// Manually refresh the session token
Accounts::session()->refresh($newToken);

// Fully clear session and token
Accounts::session()->terminate();

use Rosalana\Accounts\Facades\Basecamp;

Basecamp::users()->find($id);
Basecamp::auth()->current();
Basecamp::auth()->login($email, $password);
bash
php artisan rosalana:add
bash
php artisan rosalana:publish
bash
Http
├── Controllers
│   └── Auth
│       ├── AuthenticatedSessionController.php
│       └── RegisteredUserController.php
└── Requests
    └── Auth
        ├── LoginRequest.php
        └── RegisterRequest.php
routes
├── web.php
├── api.php
└── auth.php