Ejemplo n.º 1
0
 public function transform(TopicCover $cover = null)
 {
     if ($cover === null) {
         $cover = new TopicCover();
     }
     if ($cover->id === null) {
         $data = ['method' => 'post', 'url' => route('forum.topic-covers.store', ['topic_id' => $cover->topic_id])];
     } else {
         $data = ['method' => 'put', 'url' => route('forum.topic-covers.update', [$cover, 'topic_id' => $cover->topic_id]), 'id' => $cover->id, 'fileUrl' => $cover->fileUrl()];
     }
     $data['dimensions'] = $cover->maxDimensions;
     return $data;
 }