PHP code example of zgldh / scaffold
1. Go to this page and download the library: Download zgldh/scaffold library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
zgldh / scaffold example snippets
public function defaults()
{
return [
'site_name' => '管理平台',
'site_introduction' => '<b>各种介绍</b>',
'default_language' => 'zh-CN',
'target_planets' => [
'earth',
'mars'
],
'theme' => 'sunset' // 这是新增的设置项
];
}
public function images()
{
return $this->morphMany(Upload::class, 'uploadable')->where('z_uploads.type', __FUNCTION__);
}