Skip to content

Instantly share code, notes, and snippets.

@artistro08
artistro08 / README.MD
Last active April 4, 2024 19:53
How to setup a LEMP Development Environment with WSL2 & Valet Linux
@AshishDhamalaAD
AshishDhamalaAD / Merge specific files from one branch to another.md
Last active December 3, 2020 17:07
How to pick specific files from one branch and add it to another branch

Let's say there are two branches: master and feature-one.

There are some files that you want in the master branch from the feature-one branch but not all the files. Let's say those files are:

app/Models/User.php
app/Controllers/UsersController.php

You can accomplish that by doing the following:

@themsaid
themsaid / AppServiceProvider.php
Created January 26, 2020 16:24
Re-encryption after APP_KEY rotation
<?php
namespace App\Providers;
use App\Encrypter;
use Illuminate\Support\Str;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Config;
class ClientHint
{
@laracasts
laracasts / modal.blade.php
Last active January 28, 2022 00:13
Modals with Zero JavaScript
<div id="{{ $name }}" class="overlay">
<a href="#" class="cancel"></a>
<div class="modal">
{{ $slot }}
<a href="#" class="close">&times;</a>
</div>
</div>
@vicgonvt
vicgonvt / deployment_guide.md
Last active March 17, 2024 06:51
Deployment Guide for Ubuntu Server from Scratch with Laravel
@mishterk
mishterk / LocalValetDriver.php
Last active March 1, 2024 22:00
A local Valet driver for proxying images to a remote host
<?php
/**
* Class LocalValetDriver
*
* This class demonstrates how we might go about proxying any missing local images to a remote host. i.e; the production
* site. This has been created with WordPress in mind but could be adjusted to work with any other system.
*/
class LocalValetDriver extends WordPressValetDriver {
@fabricecw
fabricecw / migration_permission_update_v1_to_v2.php
Last active June 8, 2023 21:45
Update spatie/laravel permission tables from V1 to V2
<?php
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class PermissionUpdateV1ToV2 extends Migration
{
/**
* Run the migrations.
*
@calebporzio
calebporzio / HasUuid.php
Created July 5, 2018 17:36
A little trait to add to models that will have Uuids
<?php
// Example usage in a model:
class ExampleModel extends Model
{
use HasUuid;
protected $primaryKey = 'uuid';
<?php
namespace Vehikl\Feature\Tests;
use PHPUnit\Framework\TestCase;
class FeatureToggleTest extends TestCase
{
public function test_it_executes_the_on_method_when_the_feature_is_on()