test routing
This commit is contained in:
@ -1,7 +1,11 @@
|
||||
<?php
|
||||
namespace Controllers;
|
||||
use Models\User;
|
||||
use Models\Question;
|
||||
namespace app\controllers;
|
||||
|
||||
|
||||
use app\models\Question;
|
||||
use app\models\User;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class Users {
|
||||
public function actionCreateUser($username, $email, $password)
|
||||
@ -13,4 +17,22 @@ class Users {
|
||||
{
|
||||
return Question::where('user_id', $user_id)->count();
|
||||
}
|
||||
|
||||
public function actionViewAllUsers(): void
|
||||
{
|
||||
foreach (User::all() as $user)
|
||||
{
|
||||
echo $user->username . "<br>";
|
||||
}
|
||||
}
|
||||
|
||||
public function actionViewUser(): void
|
||||
{
|
||||
echo User::where('id', '=', 13)->get();
|
||||
// $user = User::where('id', '=', 13)->get();
|
||||
|
||||
// echo $user->username . "<br>";
|
||||
// echo $user->email . "<br>";
|
||||
// echo $user->created_at . "<br>";
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user