Skip to content

Instantly share code, notes, and snippets.

View A909M's full-sized avatar
:electron:

Assem Alwaseai A909M

:electron:
View GitHub Profile
@iamdadmin
iamdadmin / AppBootServiceProvider.php
Last active March 8, 2025 20:03
Simple, if somewhat wasteful, automatic page refresh for Filament under Frankenphp
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Route;
use Filament\Support\Facades\FilamentView;
use Filament\View\PanelsRenderHook;
use Symfony\Component\HttpFoundation\StreamedResponse;
@A909M
A909M / filament-hiding-records-in-table-until-filtered-or-searched.php
Last active May 2, 2025 17:02
If you have too many records in a single table to show immediately, you can hide them until a filter/search is applied.
->modifyQueryUsing(function (Builder $query, $livewire) {
$hasFilters = collect($livewire->tableFilters)
->filter(fn($filter) => !empty($filter['values']))
->isNotEmpty();
return ($livewire->hasTableSearch() || $hasFilters) ? $query : $query->whereRaw('1 = 0');
})
@CodeWithDennis
CodeWithDennis / HasActiveIcon.php
Created December 13, 2024 09:22
Solid Navigation Icon - FilamentPHP - Resource
<?php
namespace App\Traits;
trait HasActiveIcon
{
public static function getActiveNavigationIcon(): ?string
{
return str(self::getNavigationIcon())
->replace('heroicon-o-', 'heroicon-s-')
@A909M
A909M / SearchTranslatableField.php
Created October 25, 2024 13:37
This trait provides a search scope for models with JSON fields containing Arabic text, adding support for common Arabic character variations (like 'ه' vs. 'ة') to improve search accuracy. Usage:
<?php
namespace App\Traits;
use Illuminate\Database\Eloquent\Builder;
trait SearchTranslatableField
{
public function scopeSearchByTranslatableField(Builder $query, string $value, string $field = 'name'): Builder
{
@pj8912
pj8912 / private_github_cpanel.md
Created August 27, 2023 13:54
Connect PRIVATE GITHUB repository to CPANEL hosting account

Connect PRIVATE GITHUB repository to CPANEL hosting account

27/08/2023


Cpanel

  • Go to terminal of your cpanel account and type the command below to generate ecdsa key pair
ssh-keygen -t ecdsa -b 251 -c "EMAIL_ADDRESS"
@dsmith73
dsmith73 / brew-wsl.md
Last active May 10, 2025 15:11
install homebrew on wsl

Installing homebrew / Linuxbrew on Ubuntu-18.04 wsl for Windows 10


open wsl command line

type -

sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"  
@whitingx
whitingx / meta-tags.md
Created October 5, 2012 16:41 — forked from kevinSuttle/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>