37 lines
599 B
PHP
37 lines
599 B
PHP
<?php
|
|
|
|
namespace Laravel\Nova;
|
|
|
|
trait Metable
|
|
{
|
|
/**
|
|
* The meta data for the element.
|
|
*
|
|
* @var array
|
|
*/
|
|
public $meta = [];
|
|
|
|
/**
|
|
* Get additional meta information to merge with the element payload.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function meta()
|
|
{
|
|
return $this->meta;
|
|
}
|
|
|
|
/**
|
|
* Set additional meta information for the element.
|
|
*
|
|
* @param array $meta
|
|
* @return $this
|
|
*/
|
|
public function withMeta(array $meta)
|
|
{
|
|
$this->meta = array_merge($this->meta, $meta);
|
|
|
|
return $this;
|
|
}
|
|
}
|