Skip to content

Instantly share code, notes, and snippets.

View tabacitu's full-sized avatar

Cristian Tăbăcitu tabacitu

View GitHub Profile
@tabacitu
tabacitu / .zshrc
Last active December 22, 2020 12:19
Quickly create a Backpack Demo, serve it with Laravel Valet, open it with Sublime Text and Brave Browser on Mac OS X
# alias to the subl command
# for it to work, you need to create a symlink to the subl command somewhere in the PATH
# ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
alias sublime='subl'
# function to open the current directory in the browser, served by Laravel Valet
safari() {
open 'http://'$(basename $(pwd))'.test/';
}
@tabacitu
tabacitu / SolutionA.php
Created October 25, 2018 09:13
Proposal MonsterCrudConfiguration files
<?php
namespace App\AdminPanel\Configurations;
use Illuminate\Http\Request;
class MonsterCrudConfiguration {
public static $model = 'App\Models\Monster';
public static $entityNameSingular = 'monster';
@tabacitu
tabacitu / backpack.stack.css
Created September 20, 2018 07:47
Backpack overlay that makes AdminLTE match the Stack Multi-Purpose HTML Template
/* ------------------------------------------ */
/* ------- Backpack Stack Overlay ------------ */
/* ------------------------------------------ */
/* This file brings some subjective improvements to the AdminLTE style, to match the style provided by the Stack HTML Template. */
.sidebar-menu>li>a>.fa,
.sidebar-menu>li>a>.glyphicon,
.sidebar-menu>li>a>.ion {
margin-right: 5px;
}
@tabacitu
tabacitu / CreatedByTrait.php
Created September 3, 2017 05:38
CreatedByTrait
<?php namespace App\Models\Traits;
use Illuminate\Database\Eloquent\Model;
trait CreatedByTrait {
/**
* Stores the user id at each create & update.
*/
public function save(array $options = [])
@tabacitu
tabacitu / PermissionMiddleware.php
Created January 29, 2017 15:40
Laravel Role and Permission Middlewares
<?php
namespace App\Http\Middleware;
use Closure;
use Auth;
class PermissionMiddleware
{
/**
@tabacitu
tabacitu / gist:dbcfd71375e72c857474
Last active April 20, 2020 09:05
Tabacitu Laravel Package Service Provider boilerplate code
<?php
namespace League\Skeleton;
use Illuminate\Support\ServiceProvider;
use Illuminate\Routing\Router;
class SkeletonServiceProvider extends ServiceProvider
{
/**