Laravel Packages

Squeaky

Published
Squeaky image

Created by Jon Purvis, Squeaky is powered by Profanify, which we recently covered. Based on user feedback, he has extracted a standalone validation rule, making Squeaky a powerful tool right from the start. It also supports multiple locales, not just English.

Install this package using Composer:

composer require jonpurvis/squeaky

Example

namespace App\Http\Controllers
 
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use JonPurvis\Squeaky\Rules\Clean;
 
class EventController extends Controller
{
public function store(Request $request): RedirectResponse
{
$request->validate([
'name' => ['required', 'string', 'max:255', new Clean],
'description' => ['required', 'string', new Clean],
'event_date' => 'required|date'
]);
 
// ...
 
return redirect('/events');
}
}

If your application supports multiple languages, you can pass additional locales to the rule to accommodate them.

use JonPurvis\Squeaky\Rules\Clean;
 
'name' => ['required', 'string', 'max:255', new Clean(['en', 'pt_BR'])],

Learn more about this package and view the source code on GitHub.

Yannick Lyn Fatt photo

Staff Writer at Laravel News and Full stack web developer.

Sponsored

serpapi logo
SerpApi

The Web Search API for Your LLM and AI Applications

Visit SerpApi

The latest

View all →
CPX: The Composer Package Executor for PHP image

CPX: The Composer Package Executor for PHP

Read article
Laravel AI SDK Adds Human-in-the-Loop Tool Approval image

Laravel AI SDK Adds Human-in-the-Loop Tool Approval

Read article
Pest 5 Released With Test Impact Analysis, Agent Verification, and Evals image

Pest 5 Released With Test Impact Analysis, Agent Verification, and Evals

Read article
Queue-SQL: Run Mass Deletes and Updates Across Parallel Queue Jobs image

Queue-SQL: Run Mass Deletes and Updates Across Parallel Queue Jobs

Read article
Blade Formatting in Laravel Pint image

Blade Formatting in Laravel Pint

Read article
Inertia DevTools Is Now on the Chrome Web Store image

Inertia DevTools Is Now on the Chrome Web Store

Read article