createModel() public method

create file model
public createModel ( ) : File
return File
Example #1
0
 /**
  * Get site representative image
  *
  * @return Image
  */
 public function getSiteImage()
 {
     if (!$this->image && $this->get('uuid')) {
         $class = $this->storage->createModel();
         $files = $class->getByFileable($this->get('uuid'));
         if (count($files) > 0) {
             $file = $files instanceof Collection ? $files->first() : current($files);
             $this->image = $this->media->make($file);
         }
     }
     return $this->image;
 }