<VirtualHost *:80>
ServerName www.example.com
Redirect permanent / http://example.com/
</VirtualHost>
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; | |
use DB; | |
trait ExtendedModel | |
{ | |
public static function getColumnInfo($column) | |
{ |
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\Entities; | |
use UnexpectedValueException; | |
use Illuminate\Database\Eloquent\Builder; | |
trait HasCompositeKey | |
{ | |
/** |
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 | |
// Supondo que o formulário tenha um campo <input type="file" multiple /> chamado "images" | |
collect($request->images)->each(function ($image) { | |
// gera nome único para arquivo automaticamente (ex: 72237093253032091088276430939206.jpg) e salva na raiz | |
$filename = $image->storePublicly('.', 's3'); | |
// usa nome original do arquivo, salva numa "pasta" para o artigo (ex: articles/3/cover.png) | |
$filename = $image->storePubliclyAs($image->getClientOriginalName(), "articles/{$article_id}", 's3'); |
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 | |
class PostController | |
{ | |
public function __controller(PostRepository $postRepository) | |
{ | |
$this->postRepository = $postRepository; | |
} | |
public function index() |
- Apache Conf (Apache config highlighting)
- Auto Close Tag (HTML/XML stuff)
- Badges (Markdown badges snippets)
- Beautify (HTML/JS/CSS/SASS formatting)
- Bower (Bower management)
- Code Runner (code runner - d'oh!)
- Color Info (CSS color info tooltips)
- Composer(Composer management)
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
server { | |
listen 80; | |
server_name www.dominio.com.br; | |
return 301 $scheme://dominio.com.br$request_uri; | |
} |
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 | |
// Requires Laravel | |
$json = <<<JSON | |
[{"name": "Taylor Otwell", | |
"country": { | |
"name": "United States" | |
} | |
}, |
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 | |
$xml = <<<XML | |
<?xml version="1.0" encoding="ISO-8859-1"?> | |
<Person> | |
<Name>{name}</Name> | |
<Age>{age}</Age> | |
<Gender>{gender}</Gender> | |
</Person> | |
XML; |
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 // app/Support/Auth/Passwords/DatabaseTokenRepository.php | |
namespace App\Support\Auth\Passwords; | |
use Carbon\Carbon; | |
use Illuminate\Auth\Passwords\DatabaseTokenRepository as BaseRepository; | |
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract; | |
use Illuminate\Auth\Passwords\TokenRepositoryInterface as RepositoryContract; | |
class DatabaseTokenRepository extends BaseRepository implements RepositoryContract |