Skip to content

Instantly share code, notes, and snippets.

View kyledoesdev's full-sized avatar

Kyle Evangelisto kyledoesdev

View GitHub Profile
@kyledoesdev
kyledoesdev / hasManyThrough.php
Created December 20, 2024 16:14
hasManyThrough.php
public function relationship(): HasManyThrough
{
return $this->hasManyThrough(
// The final model
// The intermediary model
// Foreign key on the intermediary table
// Foreign key on the final table
// Local key on the current table
// Local key on the intermediary table
);
@kyledoesdev
kyledoesdev / delete-user-form.blade.php
Last active December 18, 2024 02:24
FluxUI Laravel Breeze Profile Components
<?php
use App\Livewire\Actions\Logout;
use Livewire\Volt\Component;
new class extends Component
{
public string $password = '';
public function deleteUser(Logout $logout): void
@kyledoesdev
kyledoesdev / clock.html
Created May 17, 2024 20:00
the clock script I found and use for archiving on my stream.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>A simple clock</title>
</head>
<body translate="no" >
<div id="output"
style="display: inline-block;
font-family: monospace;
@kyledoesdev
kyledoesdev / messages.blade.php
Created April 22, 2024 00:37
Laravel Tailwind CSS Success/Errors popup with dismiss.
<div class="container mx-auto mt-4">
<div class="flex justify-center">
@if (session()->has('success'))
<div x-data="{ show: true }" x-show="show" class="flex items-center p-4 mb-4 text-green-800 rounded-lg bg-green-50 dark:bg-gray-800 dark:text-green-400" role="alert">
<svg class="flex-shrink-0 w-4 h-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
<path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z"/>
</svg>
<span class="sr-only">Info</span>
<div class="ms-3 text-sm font-medium">
{{ session()->get('success') }}