mirror of
https://github.com/flarum/framework.git
synced 2024-11-25 09:32:58 +08:00
Add todo about model validation
This commit is contained in:
parent
eafdd415ef
commit
c1595af84f
|
@ -14,6 +14,12 @@ use LogicException;
|
|||
* Adds the ability for custom relations to be added to a model during runtime.
|
||||
* These relations behave in the same way that you would expect; they can be
|
||||
* queried, eager loaded, and accessed as an attribute.
|
||||
*
|
||||
* @todo Refactor out validation, either into a trait or into a dependency.
|
||||
* The following requirements need to be fulfilled:
|
||||
* - Ability for extensions to alter ruleset.
|
||||
* - Ability for extensions to add custom rules to the validator instance.
|
||||
* - Use Flarum's translator with the validator instance.
|
||||
*/
|
||||
abstract class Model extends Eloquent
|
||||
{
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
use Closure;
|
||||
|
||||
/**
|
||||
* @todo implement Symfony\Component\Translation\TranslatorInterface
|
||||
*/
|
||||
class Translator
|
||||
{
|
||||
protected $translations;
|
||||
|
@ -16,9 +19,7 @@ class Translator
|
|||
|
||||
public function plural($count)
|
||||
{
|
||||
$callback = $this->plural;
|
||||
|
||||
return $callback($count);
|
||||
return {$this->plural}($count);
|
||||
}
|
||||
|
||||
public function translate($key, array $input = [])
|
||||
|
|
Loading…
Reference in New Issue
Block a user