{"id":14974503,"url":"https://github.com/liyingxuan/laravel5.4-api-cms","last_synced_at":"2025-10-27T09:30:33.393Z","repository":{"id":144740158,"uuid":"107113783","full_name":"liyingxuan/laravel5.4-api-cms","owner":"liyingxuan","description":"基于Laravel5.4，然后根据多个【APP API + 后台管理CMS】类型的项目综合整理而出的快速打通API+CMS功能的开发模板","archived":false,"fork":false,"pushed_at":"2017-10-16T10:37:43.000Z","size":7095,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-17T05:03:39.631Z","etag":null,"topics":["laravel","laravel-model","laravel54","php"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/liyingxuan.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-16T10:36:55.000Z","updated_at":"2020-05-22T15:58:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"e21643b1-23b3-4d49-8560-c8204a1e7f39","html_url":"https://github.com/liyingxuan/laravel5.4-api-cms","commit_stats":{"total_commits":1,"total_committers":1,"mean_commits":1.0,"dds":0.0,"last_synced_commit":"5e39be162a671fdda3932def8ef7a82816e90980"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liyingxuan%2Flaravel5.4-api-cms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liyingxuan%2Flaravel5.4-api-cms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liyingxuan%2Flaravel5.4-api-cms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liyingxuan%2Flaravel5.4-api-cms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liyingxuan","download_url":"https://codeload.github.com/liyingxuan/laravel5.4-api-cms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236619372,"owners_count":19178207,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["laravel","laravel-model","laravel54","php"],"created_at":"2024-09-24T13:50:39.488Z","updated_at":"2025-10-27T09:30:32.249Z","avatar_url":"https://github.com/liyingxuan.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Laravel PHP Framework\n\n[![Build Status](https://travis-ci.org/laravel/framework.svg)](https://travis-ci.org/laravel/framework)\n[![Total Downloads](https://poser.pugx.org/laravel/framework/d/total.svg)](https://packagist.org/packages/laravel/framework)\n[![Latest Stable Version](https://poser.pugx.org/laravel/framework/v/stable.svg)](https://packagist.org/packages/laravel/framework)\n[![Latest Unstable Version](https://poser.pugx.org/laravel/framework/v/unstable.svg)](https://packagist.org/packages/laravel/framework)\n[![License](https://poser.pugx.org/laravel/framework/license.svg)](https://packagist.org/packages/laravel/framework)\n\n## 说明\n\u003e 该项目是基于Laravel5.4，然后根据多个【APP API + 后台管理CMS】类型的项目综合整理而出的快速打通API+CMS功能的开发模板。  \n目前已经成功上线的有电商、医疗、社交、在线教育等4个项目。  \n会持续更新，并补充Laravel5.5 + Vue的模板。  \n\n## Project Doc  \n- 测试Server环境：  \nApache 2.2 + MySQL 5.6 + PHP 5.6  \n[CentOS安装教程](http://mvpxuan.lofter.com/post/230e17_94f2efe)\n\n- CMS已经部署好（需配置数据库和.env之后）：  \n直接访问：localhost/cms  \n用户名：admin@admin.com  \n密码：123456  \n\n- API文档已经部署好（需配置.env之后）：  \n直接访问：localhost/doc\n\n\n### 一、项目配置\n#### 1 . 配置文件.env\n使用.env.example加入git管理，实际使用时复制.env.example文件并改名为.env：  \n\n    # cp .env.example .env\n\u003e 注意：需自行增加APP_KEY和DB的IP/账号/密码\n\n#### 2 前后端资源node_modules和vendor\n```bash\n$ npm install\n$ composer install\n```\n\n### 二、项目数据库部署\n配置env文件的数据配置之后，执行以下几条：\n```$xslt\nphp artisan migrate:install\nphp artisan migrate\nphp artisan db:seed\n```\n    \n### 三、项目目录结构\n#### 1. 路由\nroutes下api对应的是接口，web对应的是cms。\n\n#### 2. 模型\n分三个目录：\nApi（APP用户管理等）、Business（业务模块）、Cms（内容管理系统相关）\n\n#### 3. 控制器\n3.1 API控制器目录：../app/Api/Controllers/  \n\u003e API文档文件：../app/Api/Controllers/ApiDoc.php  \n\u003e 访问以下链接即可:  \n    \n    localhost/api\n\n在以下中间件中的都是需要token授权访问的内容：\n\n     /**\n     * Token Auth\n     */\n         $api-\u003egroup(['middleware' =\u003e 'jwt.auth'], function ($api) {\n         }\n\napi授权接口访问示例（通过login接口获取token）：\n\n    localhost/v1/info/all-type?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI\n\n\n3.2 验证控制器目录： ../app/Http/Controllers/Auth/  \n3.3 CMS控制器目录： ../app/Http/Controllers/Backend/  \n3.4 业务控制器目录： ../app/Http/Controllers/Business/\n\n#### 4. 视图\nCMS业务管理目录：../resources/views/\n\n#### 5. 数据库迁移和填充\n自定义迁移部分：  \n../database/migrations/2017_06_14_100454_create_menus_table.php  \n../database/migrations/2017_06_14_134742_entrust_setup_tables.php\n\n填充部分：  \n../database/seeds/DatabaseSeeder.php\n\n#### 6. Helper\n../app/Api/Helper/  \n../app/Http/Helper/\n\n#### 7. Requests\n实例文件：../app/Http/Requests/Form/MenuForm.php  \n用法：\n\n    use App\\Http\\Requests\\Form\\MenuForm;\n\n    public function store(MenuForm $request)\n    {\n        //能进入到此函数体的，都已经被MenuForm的Requests过滤了\n        /**\n            Laravel文档：\n            http://d.laravel-china.org/docs/5.4/validation\n        */\n    }\n\n#### 8. Transformers\n// TODO。\n\n\n### 四、特殊说明\n#### 1. 中间件\n../app/Http/Middleware/JwtAuthModel.php  \n该中间件为自定义，用来给API导航用哪张用户表。\n\n#### 2. 已经自带一个评论前端插件\n../resources/views/layouts/comment.blade.php\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliyingxuan%2Flaravel5.4-api-cms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliyingxuan%2Flaravel5.4-api-cms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliyingxuan%2Flaravel5.4-api-cms/lists"}