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 / howto.md
Last active December 16, 2020 18:47
How to Deploy a Laravel+Backpack project on Laravel Vapor

Note: HUGE thanks to @mwisner, he's the one who figured out the solution here, and put together the first solution here. This is just a rephrasing of his solution, as a step-by-step guide that I think will apply to most Backpack projects.

How to deploy a Laravel+Backpack project on Vapor

Step 1. Follow the Vapor docs to install vapor, vapor-core and maybe even vapor-ui. Normally you do that by running vapor init.


@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
{
/**
@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 / 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 / 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 = [])