Vagrant脚本安装 Vagrant命令只能识别Vagrantfile,通过Homestead/Vagrantfile加载Homestead/scripts目录下的homestead.rb > git clone https://github.com/laravel/homestead.git
添加 PHP 环境变量 export PATH=$PATH:/data/server/php7/bin 安装 Composer 官网查看最新版本:https://getcomposer.org/download/ wget https://getcomposer.org/composer.phar
正则表达式:^[^c],其中c为字符 例一:首字符不能为a $test1 = "a123456"; //匹配失败 if (preg_match("/^[^a]/", $test1)) { echo '匹配成功<hr />�
Magento有三种运行模式,按性能由低到高,依次为:developer < default < production 可以使用以下命令查看当前运行模式: bin/magento deploy:mode:show 使用以下命令设置运行模式: bin/magento deploy:mod
以下几种方法,都可以用来确定已经安装的Magento版本: 命令行 bin/magento --version http请求 http://<magento2-store>/magento_version 如:http://test.magento.com/magento_versio
UploadedFile Laravel通过 Input::file 可获取上传的多张图片,返回类型是 Symfony\Component\HttpFoundation\File\UploadedFile 数组。 $files = \Input::file('goods_pics
聚合方法 Laravel查询构建器提供了各种聚合方法 $users = DB::table('users')->count(); $price = DB::table('orders')->max('price'); $pri
配置信息缓存 php artisan config:cache 路由缓存 php artisan route:cache 类映射加载优化 php artisan optimize 自动加载优化 composer dump-autoload 使用 Memcached 来存储会话 config/sess
虽然Laravel提供一套包括正则匹配在内的完善的验证机制,但你一定会遇到使用规则解决不了的验证,比如数据库验证,这时需要用到Validator的验证扩展。 (1)使用静态方法:Validator::extend (2)使用对象调用:$validator->addExtension 下面是验
文件管理插件media-manager是一个对本地文件的可视化管理的工具 官方文档:http://laravel-admin.org/docs/#/zh/extension-media-manager 安装 $ composer require laravel-admin-ext/media-ma
Laravel使用Bcrypt加密方式存储及校验密码: //对 A 密码使用 bcrypt 加密 $password = Hash::make('secret'); //也可直接使用 bcrypt 的 function $password = bcrypt('sec
$result = \file_get_contents('php://input'); 解决方法:Form表单的Content-Type应设置为application/x-www-form-urlencoded(默认),不能是multipart/form-data
PHP实现图片等比例缩略图,生成正方形缩略图。 步骤:待压缩正方形图片的边长为原始图片宽度和高度的像素最小值,图片宽高较长的一边裁剪中间部分,再实现像素压缩。 <?php $imgpath = 'test.jpg'; if (!empty($imgpath)) {
$params = array(); foreach ($_POST as $key => $value) { $params[$key] = $value; } echo request_post($url, $params); function request_post($ur
直接引用 require __DIR__ . '/../common/util.function.php'; autoload composer.json "autoload": { "psr-4": { &quo