Файловый менеджер - Редактировать - /home/clickysoft/public_html/charliapp-v2.clickysoft.net/app/Http/Resources/Admin/BrainstormResource.php
Назад
<?php namespace App\Http\Resources\Admin; use Illuminate\Http\Resources\Json\JsonResource; use Owenoj\LaravelGetId3\GetId3; class BrainstormResource extends JsonResource { public function toArray($request) { // return parent::toArray($request); $descriptionsLines = explode("\n", $this->description); $audioFileURL = !empty($this->audio_file) ? asset("storage/audio/" . $this->audio_file) : null; $playtime = 0; if (!empty($this->audio_file) && \Storage::disk('public')->exists('audio/' . $this->audio_file)) {; $track = new GetId3(public_path('storage/audio/' . $this->audio_file)); $playtime = $track->getPlaytime(); } return [ 'id' => $this->id, 'brainstorm_name' => $this->brainstorm_name, 'description' => $this->description, 'lines' => count($descriptionsLines), 'audio_file_name' => $this->audio_file, 'audio_file_url' => $audioFileURL, 'image_id' => $this->image_id, 'image_url' => $this->image ? $this->image->image_url : null, "playtime" => $playtime, 'created_at' => (new \Carbon\Carbon($this->created_at))->format('F d, Y'), 'updated_at' => (new \Carbon\Carbon($this->updated_at))->format('F d, Y'), 'color_id' => $this->color->id, 'color' => $this->color->color, 'color_code' => $this->color->color_code, 'foreground_color' => $this->color->foreground_color, 'editor' => $this->editor ? true : false, 'user' => $this->user, 'comments' => $this->comments ?? [], ]; } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка