Skip to content

Instantly share code, notes, and snippets.

Avatar

Dean Tedesco developerdino

View GitHub Profile
@developerdino
developerdino / headers.conf
Created Jun 22, 2020
CORS nginx config using maps
View headers.conf
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;
View keybase.md

Keybase proof

I hereby claim:

  • I am developerdino on github.
  • I am dino (https://keybase.io/dino) on keybase.
  • I have a public key whose fingerprint is 680C BE5C 0B0B 0531 E0F8 BE5C A78A E054 C4A0 64F8

To claim this, I am signing this object:

View article-collection.json
{
"data": [
{
"type": "articles",
"id": "1",
"attributes": {
"title": "JSON API paints my bikeshed!"
},
"relationships": {
"author": {
View ArticlesResource.php
<?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
View ArticlesResource.php
<?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
View ArticleController.php
<?php
namespace App\Http\Controllers;
use App\Article;
use App\Http\Resources\ArticleResource;
use App\Http\Resources\ArticlesResource;
use Illuminate\Http\Request;
class ArticleController extends Controller
View ArticleRelationshipResource.php
<?php
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\Resource;
class ArticleRelationshipResource extends Resource
{
/**
* Transform the resource collection into an array.
View ArticleResource.php
<?php
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\Resource;
class ArticleResource extends Resource
{
/**
* Transform the resource into an array.
View article-item.json
{
"type": "articles",
"id": "1",
"attributes": {
"title": "JSON API paints my bikeshed!"
}
}
View ArticleController.php
<?php
namespace App\Http\Controllers;
use App\Article;
use App\Http\Resources\ArticleResource;
use App\Http\Resources\ArticlesResource;
use Illuminate\Http\Request;
class ArticleController extends Controller