fix vendor

This commit is contained in:
2024-07-08 16:20:25 +03:00
parent 2f2310e739
commit 0b53fce31b
1882 changed files with 436 additions and 181884 deletions

View File

@ -3,17 +3,19 @@
namespace app\controllers;
use app\helpers\Debug;
use app\models\Post;
class Posts
class PostController
{
public function actionCreatePost($post, $user_id)
{
return Post::create(['post'=>$post, 'user_id'=>$user_id]);
}
public function actionViewAllPosts()
public function actionIndex(): void
{
Debug::dd("Post list");
foreach (Post::all() as $post)
{
echo $post->post . "<br>";

View File

@ -2,15 +2,18 @@
namespace app\controllers;
use app\helpers\Debug;
use app\models\Question;
use app\models\User;
use http\Encoding\Stream\Debrotli;
use Illuminate\Contracts\View\View;
use Illuminate\Support\Facades\DB;
class Users {
public function actionCreateUser($username, $email, $password)
class UserController {
public function actionCreate(): void
{
return User::create(['username'=>$username,'email'=>$email,'password'=>$password]);
Debug::dd("create");
//return User::create(['username'=>$username,'email'=>$email,'password'=>$password]);
}
public function actionQuestionCount($user_id)
@ -18,17 +21,19 @@ class Users {
return Question::where('user_id', $user_id)->count();
}
public function actionViewAllUsers(): void
public function actionIndex(): void
{
Debug::dd("list");
foreach (User::all() as $user)
{
echo $user->username . "<br>";
}
}
public function actionViewUser(): void
public function actionView($id): void
{
echo User::where('id', '=', 13)->get();
Debug::dd($id);
echo User::where('id', '=', $id)->get();
// $user = User::where('id', '=', 13)->get();
// echo $user->username . "<br>";