mardi 1 août 2017

Laravel5.3:How to use pluck in relationship for bindign Form::select element?

this is my model

class Positions extends Model implements Repository
{
    protected $fillable = ['index_id', 'title', 'description'];
   public function index()
   {
       return $this->belongsTo('TEST\Indices', 'index_id');
   }
    public function getById($id)
    {
        return $this->with('index')->find($id);
    }
}

how to use pluck() in getById function for listing index relationship?



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

Aucun commentaire:

Enregistrer un commentaire