SCIF / propel-laravel

Propel 2 integration for Laravel framework
MIT License
4 stars 1 forks source link

Custom name for user table #2

Closed nstojanovickg closed 9 years ago

nstojanovickg commented 9 years ago

Hi, I use your Auth propel driver and I like it. But I have small problem, my auth user table is not named with 'user'. It seams to be the name of user table is hard coded in PropelUserProvider. It would be great if we can use custom name for 'user' table.

I found a way that you can easily fix this, just add: $table = \Config::get('auth.table'); in retrieveByCredentials and instead of using 'User', use $table.

I'm sorry if there is already a way to use of another name for 'user' table.

SCIF commented 9 years ago

Hi @nstojanovickg !

Just edit your schema.xml like this:

<table name="some_custom_users_tablename" idMethod="native" phpName="User">

And it will create model User mapped to custom table.

nstojanovickg commented 9 years ago

Actually it's kind of hard coding. And there are several problems:

SCIF commented 9 years ago

I just didn't figure out what you ask. Now it's clear.

It's not table — it's name of model. It configures in config as auth.model value. You are correct that now it hardcoded. I will fix it in few mins. Thanks!

nstojanovickg commented 9 years ago

Great, thanks.