Last active
December 11, 2015 22:39
-
-
Save Kindari/4670861 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php // application/models/user.php | |
| class User extends Eloquent | |
| { | |
| public static $hidden = array('password'); | |
| public function set_password($value) | |
| { | |
| return $this->attributes['password'] = Hash::make($value); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php // application/tasks/user.php | |
| class User_Task { | |
| public function run($arguments) | |
| { | |
| // Do awesome notifying... | |
| } | |
| public function make($arguments) | |
| { | |
| if (count($arguments) != 2) | |
| { | |
| echo "Usage: php artisan user:make username password" . PHP_EOL; | |
| exit; | |
| } | |
| list($username, $password) = $arguments; | |
| $user = User::create( compact('username', 'password') ); | |
| echo "Created user #{$user->id}" . PHP_EOL; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, my problem is obvious. I haven't columnt username.
But that is it. I do not want to have this column. Instead I want column
Emailas login. Where can I set user's properites?