Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
deleting all the code

Andrew Brown browner12

💭
deleting all the code
View GitHub Profile
View controller.php
<?php
namespace App\Http\Controllers;
use Illuminate\Contracts\Hashing\Hasher;
use Illuminate\Http\Request;
class ReauthorizeController extends Controller
{
/**
@browner12
browner12 / Controller.php
Created Jun 28, 2017
Polymorphic Model Builder
View Controller.php
class Controller
{
public function index(Request $request)
{
$taggable = model($request->get('taggable_type'), $request->get('taggable_id');
}
}
@browner12
browner12 / memory.php
Created May 12, 2017
Gate Optimization
View memory.php
<?php
class StringClass
{
private $abilities = [];
public function __construct($count = 1)
{
for ($a = 1; $a <= $count; $a++) {
$this->abilities['key' . $a] = 'value' . $a;
View BeanstalkdQueue.php
/**
* Get the queue or return the default.
*
* @param string|null $queue
* @return string
*/
public function getQueue($queue)
{
$queue = $queue ?: $this->default;
View MakeAllCommand.php
<?php namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Str;
class MakeAll extends Command
{
/**
* The name and signature of the console command.
*
@browner12
browner12 / ideas.md
Last active Sep 22, 2020
Forge and Envoyer Ideas
View ideas.md

Forge

  • Option when creating a new site to automatically make the Laravel schedule:run cron job.
  • Move a lot of the 'helper text' into tooltips. Less cluttered design, especially for experienced users, but still provides the info for those who need it.
  • Move all of the 'create' forms into modals (or separate pages). Brings our list of existing sites or servers above the fold. Again, lends towards a cleaner UX.
  • Similar to the Homestead aliases file, allow us to define and save alias files, that we can can include on the server when we build it.
  • Allow us to define and save different deploy scripts, that we can apply to sites. For example, save a custom one for 'production' deploys, and one for 'staging' deploys.
  • autocomplete="one-time-code" for 2FA token on login.
  • Deploy script variables. {{ sha }}
  • Add alias 'Sites'. A domain that points to another project folder. Essentially what this comes down to (I think) is allowing us to override the base part of the ng
@browner12
browner12 / autoCallback
Created Nov 15, 2014
Auto Callback for Relationship Collection
View autoCallback
<?php
class Car extends Eloquent {
//wheels relationship
public function wheels(){
return $this->hasMany('Wheel');
}
//current hack
You can’t perform that action at this time.