MicroFrameWork/app/controllers/Users.php
2024-07-03 15:15:59 +03:00

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();
}
}