igfs/app/controllers/Users.php

16 lines
383 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 {
public static function create_user($username, $email, $password)
{
return User::create(['username'=>$username,'email'=>$email,'password'=>$password]);
}
public static function question_count($user_id)
{
return Question::where('user_id', $user_id)->count();
}
}