![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
laravel
phper_陈普
这个作者很懒,什么都没留下…
展开
-
laravel require(): open_basedir restriction in effect. File(/www/wwwroot/你网站根目录/vendor/autoload.php
require(): open_basedir restriction in effect. File(/www/wwwroot/【你网站根目录】/vendor/autoload.php) is not within the allowed path1.是不是根本就不存在vendor/autoload.php文件或vendor文件夹?查看这篇文章2.如果存在vendor/autoload.p...原创 2019-04-06 13:32:50 · 6443 阅读 · 0 评论 -
Laravel-表单验证及数据保持详解
第一种:控制器验证控制器内容if ($request->isMethod('POST')) { $this->validate($request, [ 'Student.name' => 'required|min:2|max:20', 'Student.age' => 'required|integer...原创 2019-04-13 23:06:24 · 1364 阅读 · 0 评论 -
laravel框架Controller之Requset
laravel框架Controller之RequsetLaravel中的请求使用的时Symfony/http-foundation组件input() 获取请求的值public function requset1(Request $request) //这种方式叫依赖注入,Illuminate\Http\Request{ echo $request->input('sex','...原创 2019-04-09 23:49:03 · 435 阅读 · 0 评论 -
laravel之Blade模板引擎
**Blade模板引擎介绍**模板继承涉及的知识点:section,yield,extends, partent原创 2019-04-09 22:59:21 · 703 阅读 · 0 评论 -
Artisan控制台
Artisan简介简介Articsn是Laravel中自带的命令行工具名称由强大的Symfony Console 组件驱动的提供了一些对应开发有帮助的命令Artisan使用帮助查看所有可用的Artisan的命令(list)php artisanphp artisan list查看命令的帮助信息(help)php artisan help migrateAr...原创 2019-04-16 12:15:33 · 172 阅读 · 0 评论 -
laravel框架Controller之Middleware
中间件有什么用Laravel中间件提供一个方便的机制来过滤进入应用程序的HTTP请求场景有一个活动,在指定日期后开始,如果活动没开始只能访问宣传页面新建中间件注册中间件使用中间件中间件的前置和后置操作...原创 2019-04-11 22:21:26 · 484 阅读 · 0 评论 -
laravel ORM 模型
laravel ORM 模型的建立在App目录下新建模型namespace APP;use Illuminate\Database\Eloquent\Model;class Student extends Model{ //指定表名,默认是model名的复数,如Student -> students protected $table = "student";...原创 2019-04-07 23:42:04 · 813 阅读 · 0 评论 -
laravel查询构造器
首先namespace App\Http\Controllers;use Illuminate\Support\Facades\DB;class StudentController extends Controller插入 $bool = DB::insert('insert into student(name, age) values(?,?)', ['imooc', 18...原创 2019-04-07 16:34:40 · 431 阅读 · 0 评论 -
laravel中使用DBfacade实现CURD
首先引入相应的类namespace App\Http\Controllers;use Illuminate\Support\Facades\DB;class StudentController extends Controller插入 $bool = DB::insert('insert into student(name, age) values(?,?)', ['imooc',...原创 2019-04-07 13:24:40 · 253 阅读 · 0 评论 -
Laravel中Controller之Response
相应的常见类型字符串视图Json重定向字符串和视图我们都知道,这届重点讲解Json和重定向响应Json助手函数response()->json$data = [ 'errorCode' => 0, 'errMsg' => 'success', 'data' => 'sean'];return response(...原创 2019-04-10 22:16:08 · 652 阅读 · 0 评论 -
laravel模型创建
直接在 app\目录下创建model文件;namespace App;use Illuminate\Database\Eloquent\Model;class Member extends Model{ public static function getMember() { return 'member name is sean'; }...原创 2019-04-06 16:27:36 · 368 阅读 · 0 评论 -
laravel 路由规则及小坑
laravel 5.8.3的web路由在 /route/web.php中;//基础路由Route::get('/', function () { return view('welcome');});//基础路由 Route::get('basic1', function() { return 'Helloworld';}); //基础路由 Route::post...原创 2019-04-06 15:14:03 · 1601 阅读 · 0 评论 -
Laravel-通过模型处理性别
Student模型中定义常量class Student extends Model{ const SEX_UN = 0; //未知 const SEX_BOY = 1; //男 const SEX_GIRL = 2; //女 protected $table = 'student'; protected $fillable = ['name', '...原创 2019-04-13 23:59:09 · 959 阅读 · 0 评论