app\models\Closet::getItems PHP Метод

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

Get array of instances of App\Models\Texture.
public getItems ( string $category = "all" ) : array
$category string skin|cape|all
Результат array
    public function getItems($category = "all")
    {
        if ($category == "all") {
            $items = array_merge($this->textures_skin, $this->textures_cape);
        } else {
            $property = "textures_{$category}";
            $items = $this->{$property};
        }
        // reverse the array to sort desc by add_at
        return array_reverse($items);
    }

Usage Example

 public function info()
 {
     return json($this->closet->getItems());
 }