add modules and upload file
This commit is contained in:
@ -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');
|
||||
}
|
||||
}
|
@ -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' => 'Обновлен'
|
||||
];
|
||||
}
|
||||
}
|
@ -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');
|
||||
}
|
||||
}
|
@ -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' => 'Обновлен'
|
||||
];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user