PHP code example of 26b / laravel-account-status

1. Go to this page and download the library: Download 26b/laravel-account-status 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/ */

    

26b / laravel-account-status example snippets


    \TwentySixB\LaravelAccountStatus\Http\Middleware\EnsureAccountActive::class,

$user = User::factory()->queued()->make();

use TwentySixB\LaravelAccountStatus\AccountStatus;

...

/**
 * Indicate that the model's is in a queued state.
 *
 * @return \Illuminate\Database\Eloquent\Factories\Factory
 */
public function queued()
{
    return $this->state(
        function (array $attributes) {
            return [
                'status' => AccountStatus::QUEUED,
            ];
        }
    );
}

php artisan vendor:publish --tag=account-status-migrations
php artisan migrate

php artisan account-status:activate 100

php artisan account-status:toggle ID SUSPENDED

php artisan account-status:activate 50