dimanche 27 septembre 2015

laravel form model binding with has many through relationship

I wont use form model binding, and it's ok with simple models and one to one or has many relationships, but when use with has many through relationship have no effect. Is it possible? how correct handle?

Model

{!! Form::label('targeting_geo', trans('campaigns.targetingGeo') . ':', ['class' => 'control-label col-md-3']) !!}
{!! Form::select('targetingGeo[]', $targetingGeo, null, ['class' => 'form-control', 'multiple' => 'multiple']) !!}

Relation

    public function targetingGeo ()
{
    return $this->hasManyThrough(
        'App\Models\DictionariesCampaignTargetingGeo',
        'App\Models\CampaignTargetingGeo',
        'campaign_id',
        'id'
    );
}



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1h1KNL7
via IFTTT

Aucun commentaire:

Enregistrer un commentaire