This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Models; | |
use Illuminate\Database\Eloquent\Model; | |
/** | |
* Class BaseModel created to help IDE recognise all Model methods | |
* @package App\Models | |
* @mixin \Illuminate\Database\Eloquent\Builder | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function telefone_validation(telefone) { | |
//retira todos os caracteres menos os numeros | |
telefone = telefone.replace(/\D/g, ''); | |
//verifica se tem a qtde de numero correto | |
if (!(telefone.length >= 10 && telefone.length <= 11)) return false; | |
//Se tiver 11 caracteres, verificar se começa com 9 o celular | |
if (telefone.length == 11 && parseInt(telefone.substring(2, 3)) != 9) return false; |