igfs/app/controllers/Users.php

16 lines
379 B
PHP
Raw Normal View History

2024-07-03 14:41:15 +03:00
<?php
namespace Controllers;
use Models\User;
use Models\Question;
class Users {
2024-07-03 15:15:59 +03:00
public function actionCreateUser($username, $email, $password)
2024-07-03 14:41:15 +03:00
{
return User::create(['username'=>$username,'email'=>$email,'password'=>$password]);
}
2024-07-03 15:15:59 +03:00
public function actionQuestionCount($user_id)
2024-07-03 14:41:15 +03:00
{
return Question::where('user_id', $user_id)->count();
}
}