Skip to content

Instantly share code, notes, and snippets.

View jayminpanchal's full-sized avatar

Jaymin Panchal jayminpanchal

  • Ahmedabad
View GitHub Profile
@jayminpanchal
jayminpanchal / ClassFactory.php
Created June 24, 2017 18:03
Create Class object from class name
class ClassFactory
{
function __construct($namespace = '')
{
$this->namespace = $namespace;
}
public function make($source)
{
$name = $this->namespace . '\\' . $source;
@jayminpanchal
jayminpanchal / AppResourceRegistrar.php
Last active January 8, 2021 10:36
Laravel Custom Resource Registrar
use Illuminate\Routing\ResourceRegistrar;
use Illuminate\Support\Str;
class AppResourceRegistrar extends ResourceRegistrar
{
// add data to the array
/**
* The default actions for a resourceful controller.
*
@heiswayi
heiswayi / repo-reset.md
Created February 5, 2017 01:32
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A