芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/tblonline.org/app/Models/Page.php
attributes['slug'] = $this->generateSlug($value); } private function generateSlug($value) { $slug = mb_strtolower(trim(preg_replace('/[^A-Za-z0-9-]+/', '-', $value))); $count = Page::where('slug', 'LIKE', $slug . '%')->count(); $suffix = $count > 0 ? $count + 1 : ""; $slug .= $suffix; return $slug; } public function getCreatedAtAttribute($value) { $date_format = get_date_format(); $time_format = get_time_format(); return \Carbon\Carbon::parse($value)->format("$date_format $time_format"); } }