Handle data insertion after validation I have an application that has a form. Validation and data insertion works fine. However, it bulks out my controller. I've always been told skinny controllers.

For example:

class myController extends BaseController
{
    public function store(myRequest $request)
    {
        $company_id = Company::insertGetId([
            'name'      =&gt; $request-&gt;name, 
            'contact'   =&gt; $request-&gt;contact, 
            'email'     =&gt; $request-&gt;email, 
            'telephone' =&gt; $request-&gt;telephone, 
        ]);

       $this-&gt;handleQuestion($request-&gt;question_one, '1', $company_id-&gt;id);
       $this-&gt;handleQuestion($request-&gt;question_two, '2', $company_id-&gt;id);
       $this-&gt;handleQuestion($request-&gt;question_three, '3', $company_id-&gt;id);
       $this-&gt;handleQuestion($request-&gt;question_four, '4', $company_id-&gt;id);
       $this-&gt;handleQuestion($request-&gt;question_five, '5', $company_id-&gt;id);
       $this-&gt;handleQuestion($request-&gt;question_six, '6', $company_id-&gt;id);
       $this-&gt;handleQuestion($request-&gt;question_seven, '7', $company_id-&gt;id);

       Outstanding::create([
            'company_id' =&gt; $company_id-&gt;id, 
       ]);
    }

    public function handleQuestion($answer, $q_id, $company_id)
    {
        if( $question ) {
            CompanyAnswers::create([
                'company_id'  =&gt; $company_id, 
                'question_id' =&gt; $q_id, 
                'answer'      =&gt; $answer, 
            ]);      
        }   
    }
} 


The database schema has been created with a 2NF relation in mind.

companies


id (PK)
name
contact
email
telephone


company_answers


id (PK)
company_id (FK)
question_id (FK)
answer


outstanding_companies


id (PK)
company_id (FK)
question_id (FK)
answer


How is the application intended to work?


When the form is filled out, we create the company.
We ask seven questions - questions are not mandatory. (This is why we have a company_answers table - to avoid redundant data.) The results of the questions are stored in company_answers.
We insert the application in outstanding_companies so we know that this application is outstanding and needs attention.


My Problem


Have I totally misunderstood database normalisation and hindered myself by adding more code to handle data insertion?
If I have understood database normalisation, what is a better approach for handling the data insertion?
Is skinny controllers true? If so, where do I put data insertion logic?
After a lot of digging, I have finally arrived at (what I think) a better solution. 

Laravel had a feature in 5.0 called CommandBus with 5.1 they have changed the name &amp; the class structure (slightly) to Jobs. 

Jobs are Queuable or you can run them synchronously. The real benefit from using jobs are: 


Loosely coupled to the controller
Easier testing
Re-usable


This was a really good feature for me &amp; my project because an application can be submitted in multiple controllers. 

After implementation my controller now looks like this: 

public function postGuest(Requests\VoucherFormRequest $request)
{
    //return the newly created id
    $company_id     = $this-&gt;dispatchFrom('App\Jobs\CreateCompanyJob', $request);

    //set the application to outstanding
    $outstanding_id = $this-&gt;dispatch(new SetApplicationToOutstandingJob($company_id));

    //return the user_id this application needs mapping to.
    $userId         = $this-&gt;dispatch(new InsertApplicationAnswersJob($request-&gt;only('question'), $company_id));

    //finally map the application to the user chosen by our auto delegation.
    $this-&gt;dispatch(new MapOutstandingAppToUserJob($outstanding_id, $userId));

    return redirect(route('guest-published'));
}


This is the solution that I have found &amp; seems to be a huge improvement on what I had. Most likely, there will be a better solution so feedbacks always welcome!

Handling Questions

Handling questions was done by putting them in a multidimensional array within my form. 

{!! Form::text('question[6]', '', array('class' =&gt; 'app-create-input')) !!}


With this approach all I had to do was iterate through the array &amp; handle each parameter within the loop. 

foreach ($this-&gt;answers as $key =&gt; $value) {
    CompanyAnswers::create([
        'company_id'  =&gt; $this-&gt;company_id,
        'question_id' =&gt; $key,
        'answer'      =&gt; $value
    ]);
}


Normalisation

In regards to my normalisation, I cannot see any glaring issues. Even after further research. However I don't claim to be a DBA so I could very well be missing something.