Skip to content

Instantly share code, notes, and snippets.

View Queopius's full-sized avatar
🚀
Working

Queopius A. S. Queopius

🚀
Working
View GitHub Profile
@stevebauman
stevebauman / Mutable.php
Created February 16, 2023 14:50
Mutable Observers
<?php
namespace App\Observers;
trait Mutable
{
public static function mute(string|array $events = null)
{
if (is_null($events)) {
$events = ['*'];
@valorin
valorin / Middleware-CSP.php
Last active July 10, 2024 12:46
CSP Middleware - the simple CSP middleware I use across all of my projects.
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Support\Facades\Vite;
use Illuminate\Support\Str;
/**
* Simple Content Security Policy middleware.
@jeffochoa
jeffochoa / Response.php
Last active May 22, 2024 04:06
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;