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 | |
namespace App\Http\Controllers\Auth; | |
use Illuminate\Http\Request; | |
use App\Http\Controllers\Controller; | |
use App\Models\User; | |
use Illuminate\Support\Facades\Validator; | |
use Illuminate\Support\Facades\Auth; | |
use SammyK\LaravelFacebookSdk\LaravelFacebookSdk; |
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 | |
namespace Sherlock\Traits; | |
trait DateTrait { | |
protected $months = [ | |
'Jan' => 'janeiro', | |
'Feb' => 'fevereiro', | |
'Mar' => 'março', | |
'Apr' => 'abril', | |
'May' => 'maio', |
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 | |
namespace Smart\Traits\Models; | |
use File; | |
use Illuminate\Http\UploadedFile; | |
trait CoverTrait{ | |
/** | |
* Upload image when image is set | |
* |
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
var formFooter = document.getElementById("form-footer"); | |
formFooter.addEventListener("submit", function(evt) { | |
evt.preventDefault(); | |
formFooter.classList.add("form-submit"); | |
var name = document.getElementById("name"); | |
var email = document.getElementById("email"); | |
var telephone = document.getElementById("telephone"); | |
var cellphone = document.getElementById("cellphone"); |
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 | |
if (!function_exists('array_to_object')) { | |
function array_to_object(Array $data) | |
{ | |
$data = array_map( function ($item) { | |
if (is_array($item)) { | |
$item = array_to_object($item); | |
} |
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
#!/bin/bash | |
ask_yesno() { | |
question="$1 [y|N] " | |
read -p "$question" answer | |
if [[ -z $answer ]] | |
then | |
answer=n |
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 | |
public function show($slug) | |
{ | |
$lesson = $this->repository->findBySlug($slug); | |
if ($lesson) { | |
if (!empty($lesson->thumb_url)) { | |
$this->seo()->addImages($lesson->thumb_url); | |
} |
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 | |
public function show($slug) | |
{ | |
$lesson = $this->repository->findBySlug($slug); | |
if ($lesson) { | |
$this->addThumbToImages($lesson->thumb_url); | |
$trackTitle = ! $lesson->track ? '' : '['.$lesson->track->title.']'; |
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 | |
protected function indexAction() | |
{ | |
if ($this->security->isGranted('ADMIN')) { | |
$view = 'admin/index.html.twig'; | |
} else { | |
$view = 'home/access_denied.html.twig'; | |
} |
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 | |
protected function indexAction() | |
{ | |
if ($this->security->isGranted('ADMIN')) { | |
return $this->render('admin/index.html.twig'); | |
} | |
return $this->render('home/access_denied.html.twig'); | |
} |