add modules and upload file

This commit is contained in:
2024-09-06 16:53:20 +03:00
parent 4e031c7c8b
commit da77807b81
38 changed files with 180 additions and 782 deletions

View File

@ -1,14 +0,0 @@
<?php
namespace app\models;
use \Illuminate\Database\Eloquent\Model;
class Answer extends Model {
protected $table = 'answer';
protected $fillable = ['answer','user_id','question_id'];
public function upvotes()
{
return $this->hasMany('\Models\Upvote');
}
}

View File

@ -1,28 +0,0 @@
<?php
namespace app\models;
use \Illuminate\Database\Eloquent\Model;
/**
* @property int $id
* @property string $content
// * @property string $username
* @property int $user_id
* @method static where(int[] $array)
* @method static find($id)
*/
class Post extends Model
{
protected $table = 'post';
protected $fillable = ['content', 'user_id'];
public static function labels(): array
{
return [
'content' => 'Контент',
'user_id' => 'Id пользователя',
'created_at' => 'Создан',
'updated_at' => 'Обновлен'
];
}
}

View File

@ -1,22 +0,0 @@
<?php
namespace app\models;
use \Illuminate\Database\Eloquent\Model;
/**
* @method static where(string $string, $user_id)
*/
class Question extends Model {
protected $table = 'question';
protected $fillable = ['question','user_id'];
public function answers()
{
return $this->hasMany('\Models\Answer');
}
public function user()
{
return $this->belongsTo('\Models\User');
}
}

View File

@ -1,27 +0,0 @@
<?php
namespace app\models;
use Illuminate\Database\Eloquent\Model;
/**
* @property int $id
* @property string $username
* @property string $email
* @property string $password_hash
* @method static where(int[] $array)
* @method static find($id)
*/
class User extends Model {
protected $table = 'user';
protected $fillable = ['username', 'email', 'password_hash', 'role'];
protected array $dates = ['deleted at'];
public static function labels(): array
{
return [
'username' => 'Логин',
'email' => 'Email',
'created_at' => 'Создан',
'updated_at' => 'Обновлен'
];
}
}