Support the ongoing development of Laravel.io →
Configuration Blade Forms

Can it be done?

I have a collection, and a form that I loop through it

<form:model.....>

@foreach($myCollection as $item)

  {!! Form::text('event', null, ['class' => 'someclass']) !!}

@endforeach

</form>

I've done it before with a regular non-collection item (what's that called, just an object?).

And in that case it fills in the 'null' with default values.

But if I use a collection, it doesn't seem to be working. Can it be done? Or will I need to define each 'null' as

$item->event (and then I just do Form::open instead of Form::model)

which does work, but I would like to do model binding if possible on the collection.

Last updated 3 years ago.
0

Sign in to participate in this thread!

PHPverse

Your banner here too?

Nertskull nertskull Joined 3 Apr 2015

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.

© 2025 Laravel.io - All rights reserved.