Support the ongoing development of Laravel.io →
posted 10 years ago
Input

Hi, Im my app i have a function that i want to run on all user inputs before proceeding. Suppose it's a method that converts all dashed (-) to underline(_). Currently i run this method on every text input before insert into db.

$name = convert_dash ($name);

Is there any way to do it site-wide? like a hook or something that do this for me?

Last updated 3 years ago.
0

Sign in to participate in this thread!

PHPverse

Your banner here too?

shahroq shahroq Joined 14 Jun 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.