Exemplo n.º 1
0
 /**
  * @return array
  */
 public function toArray()
 {
     if ($this->isEmpty()) {
         return [];
     }
     $tags = [];
     // Check if .ico file exists
     //if ($this->isFaviconExists('ico')) {
     $tags[] = ['href' => $this->getIconPath(), 'rel' => 'icon', 'type' => 'image/x-icon'];
     //}
     // Check if .png file exists
     // if ($this->isFaviconExists('png')) {
     $tags[] = ['href' => $this->getImagePath(), 'rel' => 'icon', 'type' => 'image/png'];
     // }
     $tags = array_map(function ($attributes) {
         return Markup::make('link', $attributes)->render();
     }, $tags);
     return array_filter($tags);
 }