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/ */
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