PHP code example of cherif / algerian-mobile-phone-number-laravel
1. Go to this page and download the library: Download cherif/algerian-mobile-phone-number-laravel 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/ */
cherif / algerian-mobile-phone-number-laravel example snippets
namespace App\Models;
use Cherif\AlgerianMobilePhoneNumber\Laravel\Casts\AlgerianMobilePhoneNumberCast;
use Illuminate\Database\Eloquent\Model;
class Customer extends Model
{
protected $casts = [
'mobile_phone_number' => AlgerianMobilePhoneNumberCast::class
];
}
use Cherif\AlgerianMobilePhoneNumber\Laravel\Rules\AlgerianMobilePhoneNumberRule;
// ...
/**
* Store a new customer.
*
* @param Request $request
* @return Response
*/
public function store(Request $request)
{
$validatedData = $request->validate([
'mobilePhoneNumber' => ['