PHP Класс app\models\News

Наследование: extends App\Model
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$fillable array The attributes that are mass assignable.
$hidden array The attributes excluded from the model's JSON form.
$table string The table associated with the model.

Открытые методы

Метод Описание
category ( ) Get the category that owns the news.
getPageImageAttribute ( $value )
syncTags ( array $tags ) Sync tag relation adding new tags as needed
tags ( ) : BelongsToMany The many-to-many relationship between news and tags.
user ( ) : BelongsToMany The one-to-one relationship between news and users.

Описание методов

category() публичный Метод

The one-to-one relationship between news and category.
public category ( )

getPageImageAttribute() публичный Метод

public getPageImageAttribute ( $value )

syncTags() публичный Метод

Sync tag relation adding new tags as needed
public syncTags ( array $tags )
$tags array

tags() публичный Метод

The many-to-many relationship between news and tags.
public tags ( ) : BelongsToMany
Результат BelongsToMany

user() публичный Метод

The one-to-one relationship between news and users.
public user ( ) : BelongsToMany
Результат BelongsToMany

Описание свойств

$fillable защищенное свойство

The attributes that are mass assignable.
protected array $fillable
Результат array

$hidden защищенное свойство

The attributes excluded from the model's JSON form.
protected array $hidden
Результат array

$table защищенное свойство

The table associated with the model.
protected string $table
Результат string