安装 通过composer安装扩展包. 在根目录的composer.json文件中添加laravelcollective/html. 接着在终端中更新composer: 然后,在config/app.php文件中添加新的providers: 最后,在config/app.php中添加别名数组: 打开 ...
分类:
Web程序 时间:
2016-09-04 20:45:20
阅读次数:
274
在使用Laravel Eloquent模型时,我们可能要判断取出的结果集是否为空,但我们发现直接使用is_null或empty是无法判段它结果集是否为空的。 var_dump之后我们很容易发现,即使取到的空结果集, Eloquent仍然会返回Illuminate\Database\Eloquent\ ...
分类:
其他好文 时间:
2016-09-01 22:47:42
阅读次数:
179
1、laravel实现数据库读写分离配置或者多读写分离配置 'connections' => array( //默认mysql配置,访问test库 'mysql' => array( 'driver' => 'mysql', 'host' => '192.168.16.70', 'port' => ...
分类:
数据库 时间:
2016-09-01 20:04:44
阅读次数:
197
如何进行验证 典型的注册表单: 路由部分: 可用的验证规则 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
在安装intervention/p_w_picpath图像处理扩展报错fileinfoismissing报错信息如下:\blog>composerrequireintervention/p_w_picpathUsingversion^2.3forintervention/p_w_picpath./composer.jsonhasbeenupdatedLoadingcomposerrepositorieswithpackageinformationUpdatingdep..
分类:
其他好文 时间:
2016-09-01 00:37:53
阅读次数:
169
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
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
namespaceIlluminate\Translation;
useIlluminate\Filesystem\Filesystem;
classFileLoaderimplementsLoaderInterface
{//FileLoaderimplementsLoaderInterface
/**
*Thefilesysteminstance.
*
*@var\Illuminate\Filesystem\Filesystem
*/
protected$files;//Thefi..
分类:
Web程序 时间:
2016-08-31 12:20:09
阅读次数:
152
//2016-08-26
/**
*Checkthatthegivenfileisavalidfileinstance.
*
*@parammixed$file
*@returnbool
*/
protectedfunctionisValidFile($file)
{
return$fileinstanceofSplFileInfo&&$file->getPath()!=‘‘;
//ifbothaboutthisisokthanitisok
}//Checkthatthegivenfil..
分类:
Web程序 时间:
2016-08-29 13:22:00
阅读次数:
257