K
K
kkoshakk2016-02-01 20:49:37
Laravel
kkoshakk, 2016-02-01 20:49:37

Where to write validation rules?

Where to write validation rules? In the model or in the controller?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
Dave, 2016-02-01
@djay

In Laravel - in the controller
In Yii - in the model

M
Muhammad, 2016-02-01
@muhammad_97

That's what Form Requests are for.

K
Kirill, 2016-02-01
@synnvkz

In Requests

S
Stanislav Tarasenko, 2016-02-01
@STarasenko

)) Where tool developers recommend doing it (framework, CMS, etc.)
If you write your own tool and stick to the MCV model, the answer is: in the model.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question