16 lines
383 B
PHP
16 lines
383 B
PHP
<?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();
|
|
}
|
|
} |