Here how I use on Middleware #15
Replies: 3 comments
-
You can also directly use zg2uni(). Because zg2uni() already checked zawgyi or not.
|
Beta Was this translation helpful? Give feedback.
-
Hello! Forgive me for very late reply. Best, File:
Code: <?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
class TrimStrings extends Middleware
{
protected $except = [
'current_password',
'password',
'password_confirmation',
];
protected function transform($key, $value)
{
// Skip pattern
foreach ($this->except as $pattern) {
if (preg_match("/" . $pattern . "/", $key)) {
return $value;
}
}
// Return
return zg2uni($value);
}
} |
Beta Was this translation helpful? Give feedback.
-
Sure, please make a PR. BTW, we are building a open organization for Myanmar's dev community. The name of organization is AgeekDev. If you have a suggestion or working on a new package, you can create a new issue for that package. |
Beta Was this translation helpful? Give feedback.
-
I just found this really useful Laravel package and it saves my days.
I just added a few lines in Middleware.
It detects the Zaw Gyi string and auto converts to Unicode and modifies the request value.
Before Developer makes database logic or anything.
app/Http/Middleware/TrimStrings.php
Beta Was this translation helpful? Give feedback.
All reactions