Skip to content

Instantly share code, notes, and snippets.

View mohammad425's full-sized avatar
🏠
Working from home

Mir Mohammad Hosseini mohammad425

🏠
Working from home
View GitHub Profile
@mohammad425
mohammad425 / acf-font-awesome.php
Created February 28, 2023 07:03
Display Font Awesome Icon Field in Elementor With "Advanced Custom Fields: Font Awesome Field" Plugin
<?php
# Prevent direct file access
defined( 'ABSPATH' ) || exit;
use ElementorPro\Modules\DynamicTags\Tags\Base\Tag;
use ElementorPro\Modules\DynamicTags\ACF\Module;
class ACF_Font_Awesome extends Tag
{
@mohammad425
mohammad425 / getAllModels.php
Created August 25, 2020 18:07
Get a list of all models in Laravel
<?php
use Illuminate\Support\Facades\File;
function getAllModels(): array
{
$composer = json_decode(file_get_contents(base_path('composer.json')), true);
$models = [];
foreach ((array)data_get($composer, 'autoload.psr-4') as $namespace => $path) {
$models = array_merge(collect(File::allFiles(base_path($path)))