Skip to content

Instantly share code, notes, and snippets.

Muah ctf0

Block or report user

Report or block ctf0

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
ctf0 / Api
Last active Jul 14, 2019
api/web essentials
View Api
  • kernel.php
protected $middlewareGroups = [
    'api' => [
View array min
  • langs/*/validation.php
'array_min_items' => 'at least :value :attribute is required',
  • AppServiceProvider.php
Validator::extend('arrayMinItems', function ($attribute, $value, $parameters, $validator) {
    $validator->addReplacer('arrayMinItems', function ($message, $attribute, $rule, $parameters) {
        return str_replace(':value', $parameters[0], $message);

Border Reset

"activityBar.border": "#00000000",
"diffEditor.border": "#00000000",
"diffEditor.insertedTextBorder": "#00000000",
"diffEditor.removedTextBorder": "#00000000",
"dropdown.border": "#00000000",
"editor.findMatchBorder": "#00000000",
"editor.findMatchHighlightBorder": "#00000000",
"editor.findRangeHighlightBorder": "#00000000",
View ScrollingLettersAnimation.js
* demo1.js
* Licensed under the MIT license.
* Copyright 2018, Codrops
View change model date format.php
namespace App\Traits;
use Carbon\Carbon;
use Jenssegers\Date\Date;
use Mcamara\LaravelLocalization\Facades\LaravelLocalization;
trait HasTranslatedDates
ctf0 / paginate.php
Last active Mar 23, 2019 — forked from vluzrmos/paginate.php
Laravel Paginate Collection or Array
View paginate.php
* Gera a paginação dos itens de um array ou collection.
* @param array|Collection $items
* @param int $perPage
* @param int $page
* @return LengthAwarePaginator
View url & views in
  • add to events
// EventServiceProvider@boot()

use Illuminate\Foundation\Http\Events\RequestHandled;

app('events')->listen(RequestHandled::class, function ($event) {
    $request  = $event->request;
    $response = $event->response;
    $view = $response->original;


  • hash the id on either boot::retrieved or getIdAttribute() because delete() & forceDelete() wont work as they create a new query which will keep getting the same hashed id

  • use Route::bind in the service provider as its applying the bind globally.


  • save the hashed id to the db same as UUID but if u r using mysql, indexing will suffer
You can’t perform that action at this time.