PHP code example of labrodev / laravel-numberable

1. Go to this page and download the library: Download labrodev/laravel-numberable 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/ */

    

labrodev / laravel-numberable example snippets

 



namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Labrodev\Numberable\ModelHasNumber;

class ExampleModel extends Model
{
    use ModelHasNumber;
}

$table->string('number');
 
/**
* @return string
*/
protected function modelHasNumberTraitColumn(): string
{
    return 'your-number-column-name';
}
 
/**
* @return string
*/
protected function generateNumberByTraitModelHasNumber(int $modelId): string
{
    // your own logic to generate a number 
}

protected function predictionNumberForTraitModelHasNumber(): int 
{
   return 10000; // your prediction number
}
bash
composer analyse