Support the ongoing development of Laravel.io →
Input Forms Eloquent
Last updated 2 years ago.
0

No one? Or i am totally on the wrong way?

Last updated 2 years ago.
0

Let's say your $location is an array and your controller code looks like this:

public function getEdit($id){
    $location = Location::find($id);
    return View::make('locations.edit')->with('location',array(
        'name' => $location->name
    ));

}

Then, your form should look like this:

<div class="form-group control-group">
    {{ Form::label('Location[slug]', 'Slug',array('class' => 'control-label'))  }}
    <div class="controls">
        {{ Form::text('Location[slug]', $name, array('class' => 'form-control')) }}
    </div>
</div>

The text method accepts 3 parameters:

  1. The input type
  2. The input value
  3. Array of other options

You have set your value to null

Hope this helps

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.