I had a problem in the edit controller and edit view blade. Please hel me.
The image data and the address does not appear in the form edit.blade.php.
The image data is located in a public directory / uploads / events /.
Relationships using One To Many.
one event a multi address
The following piece of my script.
Table Structure:
Tabel events:
id
subject
description
image
Table event_addresss:
id
event_id
address
Event Model:
public function EventAddress(){
return $this->hasMany('App\EventAddress','event_id','id',address);
}
EventAddress Model:
public function Event(){
return $this->belongsTo('App\Event','event_id','id',address);
}
Controller Edit:
$data['event']=Event::findOrFail($id);
$event_addresss = Image::lists('address','image', 'id','event_id')->all();
return view('event.edit',$data,compact('event_addresss'));
Edit.blade:
{!! Form::model($event,array('url'=>'event/update','files'=>'true'))!!}
{!! Form::text('id','address',$event_addresss,null,['class'=>'form-
control','placeholder'=>trans('label.input_subject')]) !!}
{!! Form::file('image',['id'=>'input-2','class'=>'file','data-show-upload'=>'false','data-show-
caption'=>'true','multiple'=>'true']) !!}