First commit for project
This commit is contained in:
28
app/Models/Category.php
Normal file
28
app/Models/Category.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property string $slug
|
||||
* @property bool $default
|
||||
* @property bool $visible
|
||||
*/
|
||||
class Category extends Model
|
||||
{
|
||||
// use HasFactory;
|
||||
|
||||
protected $guarded = [];
|
||||
protected $casts = [
|
||||
'id' => 'integer',
|
||||
'name' => 'string',
|
||||
'slug' => 'string',
|
||||
'priority' => 'integer',
|
||||
'default' => 'bool',
|
||||
'visible' => 'bool'
|
||||
];
|
||||
}
|
38
app/Models/Project.php
Normal file
38
app/Models/Project.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property string $title
|
||||
* @property array $categories
|
||||
* @property string $author
|
||||
* @property string $image_url
|
||||
* @property Carbon $release_data
|
||||
* @property string $project_url
|
||||
* @property string $project_version
|
||||
* @property string $description
|
||||
*/
|
||||
class Project extends Model
|
||||
{
|
||||
|
||||
// use HasFactory;
|
||||
|
||||
protected $guarded = [];
|
||||
protected $casts = [
|
||||
'id' => 'integer',
|
||||
'title' => 'string',
|
||||
'categories' => 'array',
|
||||
'author' => 'string',
|
||||
'image_url' => 'string',
|
||||
'release_data' => 'datetime:d-m-Y',
|
||||
'project_url' => 'string',
|
||||
'project_version' => 'string',
|
||||
'description' => 'string'
|
||||
];
|
||||
|
||||
}
|
44
app/Models/User.php
Normal file
44
app/Models/User.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Laravel\Sanctum\HasApiTokens;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
use HasApiTokens, HasFactory, Notifiable;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'email',
|
||||
'password',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for serialization.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $hidden = [
|
||||
'password',
|
||||
'remember_token',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast.
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected $casts = [
|
||||
'email_verified_at' => 'datetime',
|
||||
];
|
||||
}
|
Reference in New Issue
Block a user