Skip to content

Instantly share code, notes, and snippets.

View LarryBarker's full-sized avatar
🚀

Larry Barker LarryBarker

🚀
View GitHub Profile
@LarryBarker
LarryBarker / provision-preview.yaml
Created May 21, 2024 05:19
Automatically deploy PRs to preview environments with the help of Laravel Forge
name: Preview Environment
on:
pull_request:
types: [opened]
env:
FORGE_API_TOKEN: ${{ secrets.FORGE_API_TOKEN }}
FORGE_SERVER_ID: ${{ secrets.FORGE_SERVER_ID }}

Glimpse banner

Glimpse: From Pull to Production, Perfectly.

As software developers one of the key foundations of success is speed and efficiency, especially being a Laravel developer, as you know which is the future of PHP. Before we talk shop, allow me to introduce myself: I’m Larry, a web developer who’s first started learning HTML in the early 90s, eventually picking up PHP (back when header and footer includes were “the way”), and more recently, working with Laravel for close to 7 years now (since version 5.4 / 5.5). My mission is to make web development more approachable, something we all know Laravel excels at.

Let me also introduce you to Glimpse: a tool designed to streamline Laravel development by automatically deploying GitHub pull requests to preview environments. Glimpse not only makes your code review and QA processes easier, but also inc

@LarryBarker
LarryBarker / CanSeedOncePerDatabase.php
Created September 16, 2024 02:55
The CanSeedOncePerDatabase trait for Laravel projects ensures that database seeders are only executed once per database.
<?php
namespace Database\Seeders;
use Illuminate\Console\View\Components\TwoColumnDetail;
use Illuminate\Support\Facades\DB;
trait CanSeedOncePerDatabase
{
protected string $seedersTable = 'seeders';