GET /{tablename}?where[<column>][]=o:<operator>;v:<value>
GET /{tablename}?whereBetween[<column>]=v:<value 1>,<value 2>
<?php | |
namespace App\Http\Middleware; | |
use Closure; | |
use Illuminate\Http\Response; | |
use Illuminate\Cache\RateLimiter; | |
class ThrottleRequests | |
{ |
Got a lot of files to upload to an S3 bucket? This little script will do it one file at a time without hitting command line limits, etc.
./upload-files-to-s3.sh <bucket-name> <directory-with-files-to-upload> <aws-profile>
<aws-profile>
is optional and defaults to default
#!/usr/bin/env bash | |
wget http://xdebug.org/files/xdebug-2.4.0rc3.tgz | |
tar -xvzf xdebug-2.4.0rc3.tgz | |
cd xdebug-2.4.0RC3 | |
phpize |
<?php | |
namespace App\Providers; | |
use Illuminate\Database\Events\QueryExecuted; | |
use Illuminate\Support\Facades\Event; | |
use Illuminate\Support\Facades\Log; | |
use Illuminate\Support\ServiceProvider; | |
class DebugServiceProvider extends ServiceProvider |
add_header "Access-Control-Allow-Credentials" $cors_allowed_credentials; | |
add_header "Access-Control-Allow-Headers" $cors_allowed_headers; | |
add_header "Access-Control-Allow-Methods" $cors_allowed_methods; | |
add_header "Access-Control-Allow-Origin" $cors_allowed_origin; | |
add_header "Access-Control-Max-Age" $cors_max_age; |
<?php | |
namespace App\Http\Resources; | |
use Illuminate\Http\Resources\Json\Resource; | |
class ArticleRelationshipResource extends Resource | |
{ | |
/** | |
* Transform the resource collection into an array. |
I hereby claim:
To claim this, I am signing this object:
{ | |
"data": [ | |
{ | |
"type": "articles", | |
"id": "1", | |
"attributes": { | |
"title": "JSON API paints my bikeshed!" | |
}, | |
"relationships": { | |
"author": { |
<?php | |
namespace App\Http\Resources; | |
use App\Comment; | |
use App\People; | |
use Illuminate\Http\Resources\Json\ResourceCollection; | |
use Illuminate\Support\Collection; | |
class ArticlesResource extends ResourceCollection |