Skip to content

Instantly share code, notes, and snippets.

View CharlieEtienne's full-sized avatar
🖖
Hi GitHub!

Charlie Etienne CharlieEtienne

🖖
Hi GitHub!
View GitHub Profile
@CharlieEtienne
CharlieEtienne / functions.php
Last active June 28, 2024 09:46
Add custom links to each image in Elementor Carousel
<?php
add_filter( 'attachment_fields_to_edit', function( $form_fields, $post ) {
$form_fields[ 'elementor_carousel_custom_link' ] = array(
'label' => __( 'Custom link', 'elementor' ),
'input' => 'text',
'value' => get_post_meta( $post->ID, 'elementor_carousel_custom_link', true ),
'helps' => __( 'This will add a link to images in Elementor Carousel', 'elementor' ),
);
@CharlieEtienne
CharlieEtienne / functions.php
Created December 12, 2021 21:23
Whitelist IPs in Elementor Maintenance Mode
<?php
function my_elementor_maintenance_mode_whitelist_ips() {
// IPs Whitelist
$whitelist = [
'127.0.0.1',
'88.123.181.218',
];
@CharlieEtienne
CharlieEtienne / CheckFilamentCompat.php
Last active August 23, 2025 14:31
Check if your Filament Plugins are ready for v4
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Http;
class CheckFilamentCompat extends Command
{
/**
#!/bin/bash
# Temporary Artisan command runner
TMP_FILE="app/Console/Commands/__TempCheckFilamentCompat.php"
# Check if it's already installed
if [ ! -f artisan ]; then
echo "❌ This is not a Laravel project (no artisan file found)."
exit 1
fi
php artisan tinker --execute '
$composer = json_decode(file_get_contents(base_path("composer.json")), true);
$deps = $composer["require"] ?? [];
$allPackages = collect($deps)->keys();
// Filter packages to only those that require filament/filament
$filamentPlugins = $allPackages->filter(function ($package) {
// Skip filament/filament itself
if ($package === "filament/filament") {
return true;
@CharlieEtienne
CharlieEtienne / Iconoir.php
Created July 14, 2025 09:04
Iconoir icons set PHP Enum
<?php
namespace App\Enums;
enum Iconoir: string
{
case ACCESSIBILITY_SIGN = "accessibility-sign";
case ACCESSIBILITY_TECH = "accessibility-tech";
case ACCESSIBILITY = "accessibility";
case ACTIVITY = "activity";