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'
    );
}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire