To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
- Homebrew
- Mountain Lion -> High Sierra
To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
Configure PHP Lumen 5 HTTP Exception Handlers with common JSON responses.
Copy (replace) only the attached files to their respective directories. app/Exceptions/Handler.php
and app/Http/Middleware/Authenticate.php
These steps should have been mentioned in the prerequisites of the Laravel Installation Guide, since I'm surely not the only person trying to get Laravel running on macOS.
Install Mcrypt using Homebrew and PECL (comes with PHP)
# PHP 7.3
Lumen version 8.x | |
通过 php artsian queue:failed_job命令生成migration文件,表的数据结构和8.x文档给的不一致,需要手动修改 |
1.为什么要进行跨域测试? | |
因为一些(跨域)的请求会被同源策略禁止,比如Ajax请求 | |
跨域资源共享(英语:Cross-origin resource sharing,缩写:CORS),用于让网页的受限资源能够被其他域名的页面访问的一种机制。 | |
主要原因是我想测试Lumen的Cors中间件(https://github.com/palanik/lumen-cors)。 | |
2.如何在本地环境进行测试? | |
谷歌浏览器(为什么是谷歌,因为我只用google浏览器)的开发者工具,打开console,输入以下JS代码 |
<?php | |
namespace App\Http\Middleware; | |
use Closure; | |
use Illuminate\Cache\RateLimiter; | |
use Illuminate\Cache\RateLimiting\Unlimited; | |
use Illuminate\Http\Exceptions\HttpResponseException; | |
use Illuminate\Http\Exceptions\ThrottleRequestsException; | |
use Illuminate\Support\Arr; | |
use Illuminate\Support\InteractsWithTime; |
openssl version -a | |
sudo add-apt-repository ppa:0k53d-karl-f830m/openssl | |
sudo apt-get update | |
sudo apt-get install openssl | |
openssl version -a |
Update: There is a more secure version available. Details
<?php
$plaintext = 'My secret message 1234';