Skip to content

Instantly share code, notes, and snippets.

Jonathan Gonçalves jonathangoncalves

Block or report user

Report or block jonathangoncalves

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
jonathangoncalves / BaseModel.php
Last active Nov 9, 2018
Adding Mixin to help the IDE understand methods in your model
View BaseModel.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
View validador-de-telefone.js
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;
You can’t perform that action at this time.