first commit

This commit is contained in:
2026-01-18 09:52:48 +08:00
commit 836bdc9409
584 changed files with 40891 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
<?php
// +----------------------------------------------------------------------
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2024 http://www.tensent.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
// +----------------------------------------------------------------------
namespace App\Models\System;
class Area extends \App\Models\BaseModel {
protected $table = 'system_areas';
protected $fillable = ['title', 'parent_id', 'status'];
protected $hidden = ['deleted_at'];
}

View File

@@ -0,0 +1,39 @@
<?php
// +----------------------------------------------------------------------
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2024 http://www.tensent.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
// +----------------------------------------------------------------------
namespace App\Models\System;
use Illuminate\Database\Eloquent\Casts\Attribute;
class Client extends \App\Models\BaseModel {
protected $table = 'system_client';
protected $fillable = ['title', 'app_id', 'secret', 'redirect', 'status'];
protected function casts(): array {
return [
'status' => 'integer',
];
}
public function appId() : Attribute {
return Attribute::make(
set: function (mixed $value, array $data){
return uniqid();
}
);
}
public function secret() : Attribute {
return Attribute::make(
set: function (mixed $value, array $data){
return md5(uniqid());
}
);
}
}

View File

@@ -0,0 +1,27 @@
<?php
// +----------------------------------------------------------------------
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2024 http://www.tensent.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
// +----------------------------------------------------------------------
namespace App\Models\System;
use Illuminate\Database\Eloquent\Casts\Attribute;
class ClientMenu extends \App\Models\BaseModel {
protected $table = 'system_client_menu';
protected $with = ['client'];
protected function casts(): array {
return [
'status' => 'integer',
'sort' => 'integer',
];
}
public function client(){
return $this->belongsTo(Client::class, 'client_id', 'id');
}
}

View File

@@ -0,0 +1,45 @@
<?php
// +----------------------------------------------------------------------
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2024 http://www.tensent.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
// +----------------------------------------------------------------------
namespace App\Models\System;
use Illuminate\Database\Eloquent\Casts\Attribute;
class Config extends \App\Models\BaseModel {
protected $table = 'system_configs';
protected $fillable = ['values', 'name', 'title', 'group', 'remark', 'type', 'status', 'sort'];
protected $hidden = ['deleted_at'];
protected function casts(): array {
return [
'option' => 'json',
];
}
public function options(): Attribute {
return Attribute::make(
get: fn (mixed $value, array $data) => [
'placeholder' => $data['title'],
'options' => $data['option'] ? json_decode($data['option'], true) : [],
],
);
}
public function label() : Attribute {
return Attribute::make(
get: fn (mixed $value, array $data) => $data['title'],
);
}
public function prop() : Attribute {
return Attribute::make(
get: fn (mixed $value, array $data) => $data['title'],
);
}
}

View File

@@ -0,0 +1,24 @@
<?php
// +----------------------------------------------------------------------
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2024 http://www.tensent.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
// +----------------------------------------------------------------------
namespace App\Models\System;
use Illuminate\Database\Eloquent\Casts\Attribute;
class Crontab extends \App\Models\BaseModel {
protected $table = 'system_crontabs';
protected $fillable = [];
protected $hidden = ['deleted_at'];
protected function casts(): array {
return [
'status' => 'integer',
];
}
}

View File

@@ -0,0 +1,22 @@
<?php
// +----------------------------------------------------------------------
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2024 http://www.tensent.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
// +----------------------------------------------------------------------
namespace App\Models\System;
use Illuminate\Database\Eloquent\Casts\Attribute;
class Dict extends \App\Models\BaseModel {
protected $table = 'system_dicts';
protected $fillable = ['title', 'values', 'group_id', 'group_name', 'sort', 'status'];
protected $hidden = ['deleted_at'];
public function group(){
return $this->belongsTo(DictGroup::class, 'group_id', 'id');
}
}

View File

@@ -0,0 +1,25 @@
<?php
// +----------------------------------------------------------------------
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2024 http://www.tensent.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
// +----------------------------------------------------------------------
namespace App\Models\System;
class DictGroup extends \App\Models\BaseModel {
protected $table = 'system_dict_groups';
protected $fillable = ['title', 'name', 'parent_id', 'sort', 'status'];
protected $hidden = ['deleted_at'];
protected function casts(): array {
return [
'parent_id' => 'integer',
'status' => 'integer',
'sort' => 'integer',
];
}
}

22
app/Models/System/Log.php Normal file
View File

@@ -0,0 +1,22 @@
<?php
// +----------------------------------------------------------------------
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2024 http://www.tensent.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
// +----------------------------------------------------------------------
namespace App\Models\System;
use App\Models\Auth\Admin;
class Log extends \App\Models\BaseModel {
protected $table = 'system_logs';
protected $fillable = ['title', 'name', 'url', 'method', 'client_ip', 'browser', 'user_id', 'data', 'remark', 'status'];
protected $hidden = ['deleted_at'];
public function user() {
return $this->belongsTo(Admin::class, 'user_id', 'uid');
}
}

View File

@@ -0,0 +1,13 @@
<?php
// +----------------------------------------------------------------------
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2024 http://www.tensent.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
// +----------------------------------------------------------------------
namespace App\Models\System;
class Modules extends \App\Models\BaseModel {
//
}

View File

@@ -0,0 +1,31 @@
<?php
// +----------------------------------------------------------------------
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2024 http://www.tensent.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
// +----------------------------------------------------------------------
namespace App\Models\System;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Support\Facades\Storage;
use App\Models\Auth\Admin;
class Tasks extends \App\Models\BaseModel {
protected $table = 'system_tasks';
protected $fillable = [];
protected $hidden = ['deleted_at'];
protected $append = ['url'];
public function url(): Attribute{
return Attribute::make(
get: fn (mixed $value, array $data) => Storage::disk('public')->url($data['file']),
);
}
public function user() {
return $this->belongsTo(Admin::class, 'user_id', 'uid');
}
}