码迷,mamicode.com
首页 >  
搜索关键字:laravel eloquent    ( 2869个结果
laravel 表单和HTML扩展包
安装 通过composer安装扩展包. 在根目录的composer.json文件中添加laravelcollective/html. 接着在终端中更新composer: 然后,在config/app.php文件中添加新的providers: 最后,在config/app.php中添加别名数组: 打开 ...
分类:Web程序   时间:2016-09-04 20:45:20    阅读次数:274
判断Laravel Eloquent获取数据结果集是否为空
在使用Laravel Eloquent模型时,我们可能要判断取出的结果集是否为空,但我们发现直接使用is_null或empty是无法判段它结果集是否为空的。 var_dump之后我们很容易发现,即使取到的空结果集, Eloquent仍然会返回Illuminate\Database\Eloquent\ ...
分类:其他好文   时间:2016-09-01 22:47:42    阅读次数:179
mysql的读写分离
1、laravel实现数据库读写分离配置或者多读写分离配置 'connections' => array( //默认mysql配置,访问test库 'mysql' => array( 'driver' => 'mysql', 'host' => '192.168.16.70', 'port' => ...
分类:数据库   时间:2016-09-01 20:04:44    阅读次数:197
laravel validate
如何进行验证 典型的注册表单: 路由部分: 可用的验证规则 regex:pattern(正则) 验证此规则的值必须符合给定的正则表达式。 accepted(yes|no|1) 验证此规则的值必须是 yes、 on 或者是 1。这在验证是否同意"服务条款"的时候非常有用。 in:foo,bar,... ...
分类:其他好文   时间:2016-09-01 12:56:33    阅读次数:193
一个低级的错误
在服务器上安装了个laravel,当服务器出错时,直接显示500错误,只返回了头部,发现是没有给权限,23333333333333 目录权限 安装 Laravel 之后,可能需要你配置一下目录权限。web 服务器需要拥有 storage 目录下的所有目录和 bootstrap/cache 目录的写权 ...
分类:其他好文   时间:2016-09-01 07:04:25    阅读次数:307
laravel安装intervention/image图像处理扩展 报错fileinfo is missing
在安装intervention/p_w_picpath图像处理扩展报错fileinfoismissing报错信息如下:\blog>composerrequireintervention/p_w_picpathUsingversion^2.3forintervention/p_w_picpath./composer.jsonhasbeenupdatedLoadingcomposerrepositorieswithpackageinformationUpdatingdep..
分类:其他好文   时间:2016-09-01 00:37:53    阅读次数:169
composer通过composer.json下载laravel包----barryvdh/laravel-debugbar
1、去Packagist网站https://packagist.org/packages/barryvdh/laravel-debugbar#dev-master找到 右边是版本,选择想要的版本,只需要复制后面的版本号就可以比如 2.2.x-dev 2、 在laravel框架里面的composer. ...
分类:Web程序   时间:2016-08-31 15:22:55    阅读次数:296
[李景山php]每天laravel-20161028|Translator.php
<?php namespaceIlluminate\Translation; useIlluminate\Support\Arr; useIlluminate\Support\Str; useIlluminate\Support\Collection; useIlluminate\Support\NamespacedItemResolver; useSymfony\Component\Translation\MessageSelector; useSymfony\Component\Translat..
分类:Web程序   时间:2016-08-31 12:22:18    阅读次数:203
[李景山php]每天laravel-20161027|FileLoader.php
<?php namespaceIlluminate\Translation; useIlluminate\Filesystem\Filesystem; classFileLoaderimplementsLoaderInterface {//FileLoaderimplementsLoaderInterface /** *Thefilesysteminstance. * *@var\Illuminate\Filesystem\Filesystem */ protected$files;//Thefi..
分类:Web程序   时间:2016-08-31 12:20:09    阅读次数:152
[李景山php]每天laravel-20161022|Request.php-3
//2016-08-26 /** *Checkthatthegivenfileisavalidfileinstance. * *@parammixed$file *@returnbool */ protectedfunctionisValidFile($file) { return$fileinstanceofSplFileInfo&&$file->getPath()!=‘‘; //ifbothaboutthisisokthanitisok }//Checkthatthegivenfil..
分类:Web程序   时间:2016-08-29 13:22:00    阅读次数:257
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!