16 lines
379 B
PHP
16 lines
379 B
PHP
<?php
|
|
namespace Controllers;
|
|
use Models\User;
|
|
use Models\Question;
|
|
|
|
class Users {
|
|
public function actionCreateUser($username, $email, $password)
|
|
{
|
|
return User::create(['username'=>$username,'email'=>$email,'password'=>$password]);
|
|
}
|
|
|
|
public function actionQuestionCount($user_id)
|
|
{
|
|
return Question::where('user_id', $user_id)->count();
|
|
}
|
|
} |