vendredi 8 juin 2018

How to insert multiple role in employee table using laravel

im building API and im struggling with store data for multiple employee role, how to store , could you provide me some example, sorry for using foreign language.. Karyawan=employee, Jabatan=role

Karyawan.php
public function jabatan(){ return $this->hasMany('\App\Jabatan','id_jabatan'); }

Jabatan.php
public function karyawan(){ return $this->belongsTo('\App\Karyawan','id_jabatan'); }

how to KaryawanController at store function should be..

this is how its look like in front end



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire