{"action":"created","issue":{"url":"https://api.github.com/repos/cartalyst/sentinel/issues/263","repository_url":"https://api.github.com/repos/cartalyst/sentinel","labels_url":"https://api.github.com/repos/cartalyst/sentinel/issues/263/labels{/name}","comments_url":"https://api.github.com/repos/cartalyst/sentinel/issues/263/comments","events_url":"https://api.github.com/repos/cartalyst/sentinel/issues/263/events","html_url":"https://github.com/cartalyst/sentinel/issues/263","id":165791527,"number":263,"title":"Overwriting/extending Throttle model (to rename/prefix the $table)","user":{"login":"caruanas","id":16971640,"avatar_url":"https://avatars.githubusercontent.com/u/16971640?v=3","gravatar_id":"","url":"https://api.github.com/users/caruanas","html_url":"https://github.com/caruanas","followers_url":"https://api.github.com/users/caruanas/followers","following_url":"https://api.github.com/users/caruanas/following{/other_user}","gists_url":"https://api.github.com/users/caruanas/gists{/gist_id}","starred_url":"https://api.github.com/users/caruanas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caruanas/subscriptions","organizations_url":"https://api.github.com/users/caruanas/orgs","repos_url":"https://api.github.com/users/caruanas/repos","events_url":"https://api.github.com/users/caruanas/events{/privacy}","received_events_url":"https://api.github.com/users/caruanas/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cartalyst/sentinel/labels/Bug","name":"Bug","color":"FC2929"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-07-15T13:52:53Z","updated_at":"2016-07-24T00:39:52Z","closed_at":"2016-07-15T20:08:26Z","body":"Hi all,\r\n\r\nfollowing the suggestions from other threads/questions (like #168), I am extending my models to be able to rename (or rather, add a prefix to) the db table names.\r\n\r\nFor example:\r\n\r\n```\r\nSentinel::getUserRepository()->setModel(\"MyEloquentUser\");\r\n\r\nclass MyEloquentUser extends \\Cartalyst\\Sentinel\\Users\\EloquentUser\r\n{\r\n\t\r\n\tfunction __construct()\r\n    {\r\n\t\t$this->table = config::getInstance()->getValue(\"dbTablePrefix\") . \"users\";\r\n    }\r\n\t\r\n\tpublic function roles()\r\n    {\r\n        return $this->belongsToMany(static::$rolesModel, config::getInstance()->getValue(\"dbTablePrefix\") . 'role_users', 'user_id', 'role_id')->withTimestamps();\r\n    }\r\n}\r\n```\r\n\r\n(where config::getInstance()->getValue(\"dbTablePrefix\") is my way of getting a common prefix).\r\n\r\nHowever there is no Sentinel::getThrottleRepository(), naturally. Since this is my first time working with Sentinel, I cannot figure out from where I can get access to set the Throttle model to point to my extended class.\r\n\r\n\r\nNote: I am using Sentinel natively, without Laravel."},"comment":{"url":"https://api.github.com/repos/cartalyst/sentinel/issues/comments/234749398","html_url":"https://github.com/cartalyst/sentinel/issues/263#issuecomment-234749398","issue_url":"https://api.github.com/repos/cartalyst/sentinel/issues/263","id":234749398,"user":{"login":"caruanas","id":16971640,"avatar_url":"https://avatars.githubusercontent.com/u/16971640?v=3","gravatar_id":"","url":"https://api.github.com/users/caruanas","html_url":"https://github.com/caruanas","followers_url":"https://api.github.com/users/caruanas/followers","following_url":"https://api.github.com/users/caruanas/following{/other_user}","gists_url":"https://api.github.com/users/caruanas/gists{/gist_id}","starred_url":"https://api.github.com/users/caruanas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caruanas/subscriptions","organizations_url":"https://api.github.com/users/caruanas/orgs","repos_url":"https://api.github.com/users/caruanas/repos","events_url":"https://api.github.com/users/caruanas/events{/privacy}","received_events_url":"https://api.github.com/users/caruanas/received_events","type":"User","site_admin":false},"created_at":"2016-07-24T00:39:52Z","updated_at":"2016-07-24T00:39:52Z","body":"I've noticed a small bug related to this.\r\n\r\nIn SentinelBootstrapper.php, in the createUsers() function, the persistence model is being pulled from the config file (as intended) like so: `$persistences = $this->config['persistences']['model'];`\r\n\r\nHowever perhaps this should also/instead be called within the `createPersistence()` function and passed to the `return new IlluminatePersistenceRepository($session, $cookie);` within that same function?\r\n\r\nThat seemed to cause the extended persistence model to be recognised."}}
{"actor":{"display_login":"caruanas"}}