简体   繁体   中英

how to insert fetch images id in to other table in laravel 4

my question is that i fetch images in different table and this image show in to user registration form all images showing in to browser now when in fill the registration table that time i select one image and selected image id store in to database i am totally confuse how to insert single image id into database my code is here..

<?= Form::open(['url' => action('UserregistrationsController@store'), 'method' => 'POST' ]) ?>
<?= 
 Form::label('name', 'Enter Name'); ?>
 <?=
 Form::text('name') ?>
 <br/>
 <?= 
 Form::label('username', 'Enter User Name');?>
 <?=    
 Form::text('username') ?>
 <br/>

 <?= 
 Form::label('password', 'Enter Password');?>
 <?= Form::password('password') ?>
 <br/>
 <?= 
 Form::label('dob', 'Select Date of Birth');?>
 <?=
 Form::text('dob') ?>
 <br/><?= 
 Form::label('gmail', 'Enter Email');?>
 <?= Form::text('gmail') ?>
 <br/> 

@foreach ($avatar as $avatars)<img src="{{{ $avatars->image->url() }}}" width="10%" height="10%" />@endforeach <br/>

I am having great difficulties understanding what you are trying to ask. First, Blade requires you to use only two pair of curly brackets, but you are using three when looping all images - you should remove one set. To the point now, if you want to submit the IDs if your images along with this form, you can simply put them into hidden fields. That way you can very easily access these IDs using the Input class after you submit the form.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM