PHP code example of shan016 / laravel-autonumber

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

    

shan016 / laravel-autonumber example snippets


$order = Order::create([
    'customer' => 'John Doe',
]);

echo $order->order_number;

// Example output: SO-00001
bash
   php artisan vendor:publish --provider="Shan016\AutoNumber\AutoNumberServiceProvider" --force
   
bash
   php artisan migrate