摘要: 1,编辑前台公共控制器BaseController.php,新增 getCates()方法和hotArts()方法 ,并用构造函数 指向它们,使得数据可以被各模板接收到 <?php namespace App\Http\Controllers\Index; use App\Http\Controll 阅读全文
posted @ 2020-05-22 10:12 pensive2019 阅读(146) 评论(0) 推荐(0)
摘要: 1,\resources\views\Index\Article\index.blade.php 模板名称改为 article.blade.php 并编辑代码如下 <html lang="zh-CN" class=" js flexbox canvas canvastext webgl no-tou 阅读全文
posted @ 2020-05-22 02:29 pensive2019 阅读(237) 评论(0) 推荐(0)
摘要: 一、展示前台首页 1,命令行创建前台首页控制器 php artisan make:controller Index/IndexController 运行后,自动生成 App\Http\Controllers\Index\IndexController.php 2,在 \resources\views 阅读全文
posted @ 2020-05-22 01:14 pensive2019 阅读(313) 评论(0) 推荐(0)
摘要: 1,复制下载到的 ueditor 文件夹到 \public\static 目录下 2,\resources\views\Admin\Article\ 目录下的 add.blade.php 和 edit.blade.php 都在头部引用相关JS 和 在底部增加js控制脚本 @section('js_h 阅读全文
posted @ 2020-05-21 23:14 pensive2019 阅读(195) 评论(0) 推荐(0)
摘要: 1,\resources\views\Admin\Article\add.blade.php 的<form>表单增加 enctype="multipart/form-data"属性 <form class="form-horizontal" role="form" action="{{route(' 阅读全文
posted @ 2020-05-20 15:34 pensive2019 阅读(242) 评论(0) 推荐(0)
摘要: 一、文章列表,新增、编辑和删除 1,编辑 App\Http\Requests\ArticleRequest.php 验证器 <?php namespace App\Http\Requests; use Illuminate\Foundation\Http\FormRequest; class Art 阅读全文
posted @ 2020-05-20 11:20 pensive2019 阅读(196) 评论(0) 推荐(0)
摘要: 一、创建文章 Article 模型、迁移文件、控制器,验证器 1,创建模型同时创建迁移文件 php artisan make:model Models/Admin/Article -m 如图示 2,创建 Article 控制器,验证器的命令行命令分别是 php artisan make:contro 阅读全文
posted @ 2020-05-19 17:59 pensive2019 阅读(270) 评论(0) 推荐(0)
摘要: 1,\resources\views\Admin\Cate\edit.blade.php 编辑为 @extends('Admin.Layout.main') @section('content') <!-- Page Breadcrumb --> <div class="page-breadcrum 阅读全文
posted @ 2020-05-19 16:02 pensive2019 阅读(264) 评论(0) 推荐(0)
摘要: 1, 编辑 \resources\views\Admin\Cate\add.blade.php 完整代码如下 @extends('Admin.Layout.main') @section('content') <!-- Page Breadcrumb --> <div class="page-bre 阅读全文
posted @ 2020-05-19 15:35 pensive2019 阅读(245) 评论(0) 推荐(0)
摘要: 一、创建文章分类cate模型、迁移文件、控制器,验证器 1,创建模型同时创建迁移文件 php artisan make:model models/Admin/Cate -m 如图示 2,创建cate控制器,验证器的命令行命令分别是 php artisan make:controller Admin/ 阅读全文
posted @ 2020-05-19 10:29 pensive2019 阅读(228) 评论(0) 推荐(0)