- var_export: documentation ( source)
<?php
class Post
{
protected $fillable = [
'title',
// ...
];
// ...
}
class Comment
{
protected $fillable = [
'title',
'post_id',
'some_other_column',
// ...
];
protected $appends = [
'title'
];
protected $with = [
'post'
];
public function __construct()
{
echo 'I should not construct!';
}
public function post() : void
{
// ...
}
public function getPostAttribute() : ?string
{
return $this->post->title ?? null;
}
}
var_export((new ReflectionClass(Comment::class))->getDefaultProperties()['fillable']);