Skip to content

Instantly share code, notes, and snippets.

@troccoli
troccoli / CookieConsent.php
Created April 30, 2021 15:09
Cookie consent livewire component
<?php
namespace App\Http\Livewire;
use Livewire\Component;
class CookieConsent extends Component
{
public bool $askForConsent;
@troccoli
troccoli / Controller.php
Last active May 25, 2021 17:26
DayOfTheWeek Laravel Validation Rule
<?php
namespace App\Http\Controllers;
use App\Rules\DayOfTheWeek;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
class DoSomethingController extends Controller
@troccoli
troccoli / ci.yml
Created June 3, 2022 17:06
Cypress, Laravel Sail, GitHub Action
# .github/workflows/ci.yml
name: CI
on: push
env:
node-modules-cache-name: cache-node-modules-5
composer-packages-cache-name: cache-composer-packages-5
build-artifacts-cache-name: cache-build-artifacts-5
@troccoli
troccoli / app.js
Created August 23, 2024 16:59
Theme switcher for Laravel Breeze Blade UI
// resources/js/app.js
import './bootstrap';
import {ThemeSwitcher} from './theme-switcher';
ThemeSwitcher.init()