Skip to content

Instantly share code, notes, and snippets.

View erenhatirnaz's full-sized avatar
🏠
Working from home

Eren Hatırnaz erenhatirnaz

🏠
Working from home
View GitHub Profile
class AuthController extends Controller
{
/**
* User Login
*
* @OA\Post(
* path="api/auth/login",
* tags={"Auth"},
* @OA\RequestBody(ref="#/components/requestBodies/LoginRequest"),
* @OA\Response(
/**
* ...
*
* @OA\Response(
* response="UnauthorizedError",
* description="Unauthorized",
* @OA\JsonContent(
* ref="#/components/schemas/Error",
* example={"code": "unauthenticated", "message": "User hasn't signed in."}
* )
/**
* ...
*
* @OA\Schema(
* schema="Error",
* @OA\Property(property="code", type="string", description="Error code", example="common.not-found"),
* @OA\Property(property="message", type="string", description="Error message", example="Resource not found."),
* )
* @OA\Schema(
* schema="Success",
@erenhatirnaz
erenhatirnaz / AddressController.php
Created October 24, 2021 14:06
AddressController@show
/**
* @OA\Parameter(
* parameter="AddressId",
* description="Address ID",
* in="path",
* name="id",
* @OA\Schema(type="integer"),
* required=true,
* example=1,
@erenhatirnaz
erenhatirnaz / AddressController.php
Last active March 29, 2022 07:34
AddressController@index
class AddressController extends Controller
{
/**
* Index
*
* @OA\Get(
* path="/api/address",
* tags={"Address"},
* security={{ "token": {} }},
* @OA\Response(response=401, ref="#/components/responses/UnauthorizedError"),
@erenhatirnaz
erenhatirnaz / l5-swagger.php
Created October 24, 2021 12:22
l5-swagger config
<?php
return [
// ...
'securityDefinitions' => [
'securitySchemes' => [
'token' => [
'type' => 'http',
'description' => 'Bearer token for user',
'scheme' => 'bearer',
@erenhatirnaz
erenhatirnaz / Address.php
Last active November 3, 2021 05:53
Address Resource
/**
* @OA\Schema(
* schema="Address",
* @OA\Property(property="id", type="integer", description="Address ID", example=1),
* @OA\Property(property="type", type="string", enum={"home", "work", "other"}, description="Type", example="home"),
* @OA\Property(property="title", type="string", minLength=2, description="Title", example="Ev adresim"),
* @OA\Property(property="address", type="string", minLength=10, description="Address", example="Bahçeşehir 2. Kısım 12. Caddesi no: 12I İstanbul Başakşehir"),
* @OA\Property(property="address_recipe", type="string", minLength=2, description="Address recipe", example="erdal bakkal karşısı"),
* @OA\Property(property="lat_long", type="string", description="Coordinates, Format: LAT, LONG", example="41.08442, 28.67263"),
* @OA\Property(property="city", type="string", description="City", example="İstanbul"),
@erenhatirnaz
erenhatirnaz / LoginRequest.php
Last active November 3, 2021 05:52
AuthController@login
/**
* @OA\RequestBody(
* request="LoginRequest",
* required=true,
* @OA\JsonContent(
* required={"email", "password"},
* @OA\Property(property="email", type="string", description="E-mail address", example="john.doe@example.com"),
* @OA\Property(property="password", type="string", description="Password", example="123456"),
* )
* )
@erenhatirnaz
erenhatirnaz / Controller.php
Last active November 3, 2021 05:51
Controller.php
/**
* @OA\Info(
* title="Laravel OpenAPI Example",
* version="1.0"
* )
*
*/
class Controller extends BaseController
{
@erenhatirnaz
erenhatirnaz / auto-expander.user.js
Last active January 31, 2021 21:29
GitHub Dashboard Auto Expander
// ==UserScript==
// @name GitHub Dashboard Auto Expander
// @description This userscript clicks all 'expand' buttons on the dashboard
// @version 1.0
// @author Eren Hatırnaz
// @homepageURL https://gist.github.com/erenhatirnaz/754a561cca7b4310b86269af5c812afa
// @grant none
// @match https://github.com/
// ==/UserScript==