File: D:/HostingSpaces/SBogers10/honger.komma.pro/app/KommaApp/Kms/Core/Attributes/File.php
<?php
namespace App\KommaApp\Kms\Core\Attributes;
use App\KommaApp\Kms\Core\Attributes\Traits\LabelTrait;
use Illuminate\Support\MessageBag;
/**
* Class File
*
* For uploading files but not store them.
* If you also want to store them, you need to use another attribute
*
* @package App\KommaApp\Kms\Core\Attributes
*/
class File extends Attribute
{
use LabelTrait;
/** @var string $accept */
protected $accept;
/**
* Title constructor.
* @param string $label
*/
public function __construct(string $label = '')
{
$this->setLabelText($label);
parent::__construct();
}
/**
* Returns a view that visually represents this attribute
*
* @return \Illuminate\View\View
*/
public function render()
{
return \View::make('kms/attributes.file', [
'attribute' => $this,
'successes' => (\Session::has('successes')) ? \Session::get('successes') : new MessageBag()
]);
}
/**
* @return string
*/
public function getAccept(): string
{
return $this->accept;
}
/**
* @param string $accept
* @return File
*/
public function setAccept(string $accept): self
{
$this->accept = $accept;
return $this;
}
}