In this tutorial, just want to expose the basic of API Development with plain PHP.
You should install https://www.getpostman.com/ before proceed with this tutorial.
- Understand what is the
headers - Understand the
Content-Type
| { | |
| "quotes": [ | |
| { | |
| "quote":"Life isn’t about getting and having, it’s about giving and being.","author":"Kevin Kruse"}, | |
| { | |
| "quote":"Whatever the mind of man can conceive and believe, it can achieve.","author":"Napoleon Hill"}, | |
| { | |
| "quote":"Strive not to be a success, but rather to be of value.","author":"Albert Einstein"}, | |
| { |
In this tutorial, just want to expose the basic of API Development with plain PHP.
You should install https://www.getpostman.com/ before proceed with this tutorial.
headersContent-TypeBefore proceed, you may want to follow up
Create a middleware
Before proceed, you may want to follow up Send Welcome Email Notification with Event and Listener.
Create new migration script to add activation_token and activated_at column in users table.
php artisan make:migration add_activation_column --table=users
| <?php | |
| namespace App\Http\Controllers\Api\Auth; | |
| use App\Http\Controllers\Controller; | |
| use Illuminate\Http\Request; | |
| use Illuminate\Foundation\Auth\SendsPasswordResetEmails; | |
| use Illuminate\Support\Facades\Password; | |
| class ForgotPasswordController extends Controller |
Ensure there's folder docs/ in root directory. Then:
generate-toc.php.php generate-toc.phpfrontend localnodes
bind *:80
reqadd X-Forwarded-Proto:\ http
# Add CORS headers when Origin header is present
capture request header origin len 128
http-response add-header Access-Control-Allow-Origin %[capture.req.hdr(0)] if { capture.req.hdr(0) -m found }
rspadd Access-Control-Allow-Methods:\ GET,\ HEAD,\ OPTIONS,\ POST,\ PUT if { capture.req.hdr(0) -m found }
rspadd Access-Control-Allow-Credentials:\ true if { capture.req.hdr(0) -m found }