Save all HTML field names in Controller - it is bad or not bad idea? I have sample controller InboxController in my Inbox app. I want control with field name from my controller. If I will control with fields name from controller will not be destroyed MVC rules?

&lt;?php

namespace App\Http\Controllers;

use App\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Validator;

class InboxController extends Controller
{
    /*
    |--------------------------------------------------------------------------
    | Field names in HTML form
    |--------------------------------------------------------------------------
    */

    /**
     * Recipient field name.
     *
     * @var string
     */

    public $recipient = 'recipient';

    /**
     * Sender field name.
     *
     * @var string
     */

    public $sender = 'sender';

    /**
     * Subject field name.
     *
     * @var string
     */
}


Html code:

&lt;input type='text' name="{{ $sender }}"&gt;
I recomend you to use Symfony like form builder. There you can create one form and reuse it anywhere. 

$form = FormFactory::create(FormType::class, $user)
    -&gt;add('name', TextType::class)
    -&gt;add('email', EmailType::class, [
        'rules' =&gt; 'unique:users,email',
    ])
    -&gt;add('save', SubmitType::class, ['label' =&gt; 'Save user']);


What is also good is with this form you can also validate your input at the same time.

 $form-&gt;handleRequest();



 if ($form-&gt;isSubmitted() &amp;&amp; $form-&gt;isValid()) {
      //Your code
 }


Here is link for repository