Skip to content

Instantly share code, notes, and snippets.

View antogkou's full-sized avatar
🌍
Working from everywhere

Antonis Gkoutzamanis antogkou

🌍
Working from everywhere
View GitHub Profile
@MrPunyapal
MrPunyapal / GenerateUniqueSlug.php
Created November 29, 2023 16:40
Efficient Laravel Slug Generation: Unique, Sleek, and No Looping 🚀
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
class Blog extends Model
{
@MrPunyapal
MrPunyapal / LaravelWhereLikeMacro.php
Last active April 12, 2024 03:32
Laravel Custom 'whereLike' Macro for Dynamic 'LIKE' Searches including relationships
<?php
namespace App\Providers;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Arr;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{