This file contains hidden or 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
| $userfb = Socialite::driver('facebook')->user(); | |
| $user = User::where('idsocial' ,$userfb->getId())->first(); | |
| if(!$user){ | |
| $user = new User(); | |
| $user->idsocial = $userfb->getId(); | |
| $user->social = "Facebook"; | |
| $user->avatar = $userfb->getAvatar(); | |
| $user->name = $userfb->getName(); | |
| $user->email = $userfb->getEmail(); | |
| $user->password = bcrypt('temp'); |
This file contains hidden or 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
| class pagseguro extends MX_Controller | |
| { | |
| public function __construct() { | |
| parent::__construct (); | |
| $this->load->library('PagSeguroLibrary'); | |
| } | |
| /** | |
| * retornoPagamentoPagseguro |
This file contains hidden or 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 | |
| $reg_exUrl = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/"; | |
| $text = "Visite: http://google.com e pesquise antes de perguntar."; | |
| if(preg_match($reg_exUrl, $text, $url)) { | |
| echo preg_replace($reg_exUrl, "<a href=$url[0]>$url[0]</a>", $text); | |
| } else { | |
| echo $text; |
This file contains hidden or 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
| $user = $users->where('id', Sentry::getUser()->id) | |
| ->whereHas('clientes', function($q){ | |
| $q->where('cnpj', \Input::get('destinatario')); | |
| $q->whereHas('configuracoes', function($q){ | |
| # Apenas clientes que tenham certificado configurado | |
| $q->whereNotNull('ambiente'); | |
| $q->limit(1); |
This file contains hidden or 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
| select * from `users` where `id` = '10' and (select count(*) from `clientes` inner join `users_clientes` on `clientes`.`id` = `users_clientes`.`clientes_id` where `users_clientes`.`users_id` = `users`.`id` and `cnpj` = '20434235000106' and (select count(*) from `configuracoes_nfe` where `configuracoes_nfe`.`clientes_id` = `clientes`.`id` and `ambiente` is not null limit 1) >= 1 limit 1) >= 1 limit 1 |
This file contains hidden or 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
| foreach ($user as $key) { | |
| echo $key->id . PHP_EOL; | |
| foreach ($key->clientes as $key) { | |
| echo $key->nome; | |
| } | |
| } |
This file contains hidden or 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
| $user = $users->where('id', Sentry::getUser()->id) | |
| ->whereHas('clientes', function($q){ | |
| $q->where('cnpj', \Input::get('destinatario')); | |
| $q->whereHas('configuracoes', function($q){ | |
| # Apenas clientes que tenham certificado configurado | |
| $q->whereNotNull('ambiente'); | |
| $q->limit(1); |
This file contains hidden or 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
| #a:hover + #b #c { | |
| background: #ccc | |
| } | |
| <div id="a">Div A</div> | |
| <div id="b">hello<div id="c">world</div></div> |
This file contains hidden or 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
| protected static function boot() { | |
| parent::boot(); | |
| static::deleting(function($produtos) { | |
| if ($produtos->imagens()->count() > 0) | |
| { | |
| $produtos->imagens->delete(); | |
| # File::delete(public_path().'id.jpg'); | |
| } | |
| }); | |
| } |
This file contains hidden or 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
| class Wiki_Creature extends \Illuminate\Database\Eloquent\Model { | |
| protected $table = 'wiki_creature'; | |
| protected $with = ['getloot']; | |
| public function getLoot() | |
| { | |
| return $this->hasMany('DevAAC\Models\Wiki_Creature_Loot', 'name'); | |
| } |