title: After creating new position in database, redirect directly to the newly created view
body: <p>AT my website you can create collaborators. I have a blade view with a table where you can see all of them. I want after creating new collaborator to return the main view of newly created collaborator.</p>
  
  <p>I was thinking that I can either add it in my javascript function or maybe in route function instead of <code>return back</code> use like <code>return view('person.profile.profile-view');</code> but I don't know how to pass all the data I need from a newly created field. </p>
  
  <p>Also, my collaborator view needs a lot of data, here is the controller for it:</p>
  
  <pre class="lang-php prettyprint-override"><code> public function profileView($id)
      {
          $person = $this-&gt;personRepository-&gt;getByIdWith($id, ['person_title', 'country', 'salutation']);
          $practitioner_id = $this-&gt;practitionerRepository-&gt;getIdByPersonId($id);
          $practitioner = $this-&gt;practitionerRepository-&gt;getById($practitioner_id);
          $specialty_id = PractitionerSpecialty::where('practitioner_id', $practitioner_id)-&gt;value('specialty_id');
  
          return view('person.profile.profile-view')
              -&gt;with('person', $person)
              -&gt;with('id', $id)
              -&gt;with('person_titles', $this-&gt;personTitleRepository-&gt;getAll())
              -&gt;with('countries', Country::all())
              -&gt;with('specialties', Specialty::all())
              -&gt;with('specialty', Specialty::where('specialty_id', $specialty_id)-&gt;value('name'))
              -&gt;with('competence_levels', CompetenceLevel::all())
              -&gt;with('salutations', PersonSalutation::all())
              -&gt;with('practitioner', $practitioner)
              -&gt;with('practitioner_specialty', PractitionerSpecialty::where('practitioner_id', $practitioner_id)-&gt;first())
              -&gt;with('practitioner_competence_level', PractitionerCompetenceLevel::where('practitioner_id', $practitioner_id)-&gt;first());
      }
  </code></pre>
  
  <p>My php create form</p>
  
  <pre><code>&lt;div class="modal fade crud-modal" id="create-Modal" tabindex="-1" role="dialog" style="z-index: 1050; display: none;"
       aria-hidden="true"&gt;
  
                 [...]                     
  
              &lt;div class="modal-footer"&gt;
                  &lt;button type="button" class="btn btn-default btn-round waves-effect "
                          data-dismiss="modal"&gt;{{trans('buttons.close')}}&lt;/button&gt;
                  &lt;button type="button" id="create_final_btn" class="btn btn-success btn-round"
                          &gt;{{trans('buttons.add')}}&lt;/button&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <pre><code>var create = (function(){
      var onSuccess;
      var onHashSuccess;
  
      var createButton = function(fieldValues, createUrl, required) {
          $("#create_final_btn").click(function () {
              forms.postObject(forms.readForm(fieldValues, '_create', undefined,  required), createUrl, onSuccess);
          });
      };
  
      [...]
  
      var setOnSuccess = function(fun) {
        onSuccess = fun;
      };
      var setOnHashSuccess = function(fun) {
          onHashSuccess = fun;
        };
  
      return {
          createButton: createButton,
          createHashItemButton: createHashItemButton,
          openCreateDialogButton: openCreateDialogButton,
          setOnSuccess: setOnSuccess,
          setOnHashSuccess: setOnHashSuccess,
          openCreateTrainingPlanButton: openCreateTrainingPlanButton
      };
  }());
  </code></pre>
  
  <p>My function in routes:</p>
  
  <pre class="lang-php prettyprint-override"><code>public function addPerson(Request $request) {
          $this-&gt;validate($request, [
                  'data' =&gt; 'required',
                  'data.first_name' =&gt; 'required',
                  'data.last_name' =&gt; 'required',
                  'data.active' =&gt; 'required',
                  'data.person_salutation_id' =&gt; 'required',
  
              ]
          );
          $this-&gt;repository-&gt;create($request-&gt;all()['data']);
          return back();
      }
  </code></pre>
  
  <p>I think the best way would be to do that in javascript function. If someone can lead me to the best solution that would be great.</p>