PHP code example of gabeta / lara-pnn

1. Go to this page and download the library: Download gabeta/lara-pnn 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/ */

    

gabeta / lara-pnn example snippets


Gabeta\LaraPnn\laraPnnServiceProvider::class

'LaraPnn' => Gabeta\LaraPnn\Facades\LaraPnn::class,

use Gabeta\LaraPnn\InteractWithLaraPnn;
use Gabeta\LaraPnn\LaraPnnAbstract;

class YourModel extends Model implements LaraPnnAbstract
{
    use InteractWithLaraPnn;
}

use Gabeta\LaraPnn\InteractWithLaraPnn;
use Gabeta\LaraPnn\LaraPnnAbstract;

class YourModel extends Model implements LaraPnnAbstract
{
    use InteractWithLaraPnn;

    protected $pnnFields = [
        'mobile' => ['mobile_field_name'],
        'fix' => ['fix_field_name']
    ];
}

use Gabeta\LaraPnn\InteractWithLaraPnn;
use Gabeta\LaraPnn\LaraPnnAbstract;

class YourModel extends Model implements LaraPnnAbstract
{
    use InteractWithLaraPnn;

    protected $pnnFields = [
        'mobile' => ['mobile_field_name'],
        'fix' => ['fix_field_name']
    ];
    
    protected $pnnDialCodeFields = [
        'mobile_field_name' => 'mobile_dial_code_field_name',
        'fix_field_name' => 'fix_dial_code_field_name'
    ];
}


// Before use LaraPnn trait
$yourModel->mobile_field_name // 225 09 00 00 00 
$yourModel->fix_field_name // 225 20 30 00 00 

// After use LaraPnn trait
$yourModel->mobile_field_name // 225 07 09 00 00 00  
$yourModel->fix_field_name // 225 27 20 30 00 00 

shell
php artisan vendor:publish --provider="Gabeta\LaraPnn\laraPnnServiceProvider"
shell
php artisan larapnn:migrate YouModelNamepace\\YourModel
shell
php artisan larapnn:rollback YouModelNamepace\\YourModel
shell
php artisan larapnn:migrate YouModelNamepace\\YourModel --take=50000

php artisan larapnn:rollback YouModelNamepace\\YourModel  --take=50000
shell
php artisan larapnn:migrate YouModelNamepace\\YourModel --skip

php artisan larapnn:rollback YouModelNamepace\\YourModel --skip