1. Go to this page and download the library: Download aurorawebsoftware/aauth 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/ */
aurorawebsoftware / aauth example snippets
use Illuminate\Foundation\Auth\User as Authenticatable;
use AuroraWebSoftware\AAuth\Traits\AAuthUser;
use AuroraWebSoftware\AAuth\Contracts\AAuthUserContract;
class User extends Authenticatable implements AAuthUserContract
{
use AAuthUser;
// ...
}
namespace App\Models\ExampleModel;
use AuroraWebSoftware\AAuth\Interfaces\AAuthOrganizationNodeInterface;
use AuroraWebSoftware\AAuth\Traits\AAuthOrganizationNode;
use Illuminate\Database\Eloquent\Model;
class ExampleModel extends Model implements AAuthOrganizationNodeInterface
{
use AAuthOrganizationNode;
// implementation
}
$permissions = AAuth::permissions();
AAuth::can('create_something_for_organization');
if (AAuth::can('create_something_for_organization')) {
// codes here
}