Skip to content

Instantly share code, notes, and snippets.

@jtelesforoantonio
jtelesforoantonio / WithoutAppends.php
Created October 30, 2020 19:15
Disable default model appends for Laravel
<?php
namespace App\Traits\Model;
trait WithoutAppends
{
/**
* Determines if the defaults appends fields will be present.
*
* @var bool
@jtelesforoantonio
jtelesforoantonio / WithoutRelationships.php
Created October 30, 2020 19:15
Disable the default model relationships for Laravel
<?php
namespace App\Traits\Model;
trait WithoutRelationships
{
/**
* Determines if the defaults relationships will be present.
*
* @var bool
@jtelesforoantonio
jtelesforoantonio / DeleteTestInterface.php
Created April 20, 2020 20:55
Test Interfaces REST API with Laravel
<?php
namespace Tests\Feature\Contracts;
interface DeleteTestInterface
{
/**
* Unauthorized to delete an item.
*
* @return void
@jtelesforoantonio
jtelesforoantonio / .editorconfig
Created April 20, 2020 20:46
Editor config file for Express and Vue
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
@jtelesforoantonio
jtelesforoantonio / .gitignore
Created April 20, 2020 20:41
Gitignore file for Vue
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
@jtelesforoantonio
jtelesforoantonio / .gitignore
Created April 20, 2020 20:36
Gitignore file for Expressjs
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
@jtelesforoantonio
jtelesforoantonio / ApiResponse.php
Last active July 21, 2024 08:40
Trait API Responses for Laravel
<?php
namespace App\Traits;
use Illuminate\Http\JsonResponse;
use Symfony\Component\HttpFoundation\Response;
trait ApiResponses
{
/**