File: D:/HostingSpaces/SBogers10/centrum8a.komma.pro/app/KommaApp/Kms/Core/Attributes/Staggering.php
<?php
/**
* Created by PhpStorm.
* User: julesgraus
* Date: 29/11/17
* Time: 11:50
*/
namespace App\KommaApp\Kms\Core\Attributes;
use Illuminate\Database\Eloquent\Model;
class Staggering extends Attribute
{
public function __construct()
{
parent::__construct();
$uuid = uniqid('seperator', true);
$this->mapValueFrom(Attribute::ValueFromItself, $uuid);
parent::setValue($uuid);
}
/**
* Returns a view that visually represents this attribute
*/
public function render()
{
//get id from model
$currentId = null;
foreach(request()->route()->parameters as $parameter)
{
if(is_a($parameter, Model::class))
{
$currentId = $parameter->id;
}
}
return \View::make('kms/attributes.staggering');
}
}