-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Load custom dict with locale set on non supported one #2
Comments
Hi @aletundo. Thanks for this issue.. I will try replicate it. Would you lend me your Regards! |
Yes, for sure! It was a merge of the dictionaries from banbuilder and Laravel5-Profanity-Filter.
Okay! I may make a pull a request.. I have just to give look at your unit tests. |
@aletundo Well, the error is because I don't have a <?php
// ....
public function store(Request $request)
{
$this->validate($request, [
'name' => 'required|profane:en,es,'.resource_path('lang/it/dict.php')
]);
// In case it passes
return response()->json(['name' => $request->input('name')]);
} You can send a pull request to add that Regards! |
@arandilopez I got the point! It works now! I'm going to make a pull request asap. |
Hi @arandilopez ! First of all I really appreciated your package.
I'm trying to use a custom dictionary file loading it as following:
'name' => 'required|string|max:100|profane:en,' . resource_path('lang/it/profane.php')
My locale is set on
it
language which is not supported out of the box. I'm stuck on this exception:ErrorException(code: 0): include(it): failed to open stream: No such file or directory at /var/www/myproject/vendor/arandilopez/laravel-profane/src/ProfaneValidator.php:85
I debugged your code a little bit. I noticed that the variable
$dictionary
used in lineProfaneValidator.php:85
contains the locale value. So it expects a path but it is the locale string.As ultimate test I tried to change
$dict = include($dictionary);
on line 85 with$dict = include(resource_path('path/to/my/dict.php');
at it worked.Thank you!
The text was updated successfully, but these errors were encountered: