krafthaus / bauhaus

Laravel 4 Admin Generator
http://bauhaus.krafthaus.nl/
GNU General Public License v2.0
1 stars 0 forks source link

Enable dot syntax to get field from belongsTo model #54

Closed mrk-j closed 9 years ago

mrk-j commented 9 years ago

Possible fix for #46, maybe @jspekken can check this out?

It works like this:

Model

<?php
class Model
{
    public function reference()
    {
        return $this->belongsTo('ReferencedModel');
    }
}

Admin

<?php
class ModelAdmin extends Admin
{
    public function configureList($mapper)
    {
        $mapper->identifier('reference.field');
    }
}
mrk-j commented 9 years ago

Maybe the PR seems a bit messy. I should have created a separate branch for my first PR.

mrk-j commented 9 years ago

Created a new fork and created a new branch for this fix, I should have created a separate branch in my previous fork.

See #57 for this PR in a separate branch.