PHP code example of mr-vaco / nova-statuses-manager

1. Go to this page and download the library: Download mr-vaco/nova-statuses-manager 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/ */

    

mr-vaco / nova-statuses-manager example snippets

 artisan vendor:publish --tag=mr_vaco__statuses
 artisan migrate

StatusClass::DEFAULT_ID()->id
StatusClass::DEFAULT_ID()->name
StatusClass::DEFAULT_ID()->color

StatusClass::ACTIVE()->id
StatusClass::ACTIVE()->name
StatusClass::ACTIVE()->color

StatusClass::DISABLED()->id
StatusClass::DISABLED()->name
StatusClass::DISABLED()->color

StatusClass::DRAFT()->id
StatusClass::DRAFT()->name
StatusClass::DRAFT()->color

StatusClass::BY_ID($id)->name
StatusClass::BY_ID($id)->color

use MrVaco\NovaStatusesManager\Classes\StatusClass;
use MrVaco\NovaStatusesManager\Fields\Status;

public function fields(NovaRequest $request): array
{
    return [
        Status::make(__('Status'), 'status')
            ->options(StatusClass::LIST('short'))
            ->default(StatusClass::ACTIVE()->id),
    ];
}
StatusClass::BY_ID($id)