HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/edwingovers.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');
    }
}