Skip to content

Instantly share code, notes, and snippets.

View tabuna's full-sized avatar

Alexandr Chernyaev tabuna

View GitHub Profile
@tabuna
tabuna / User.php
Created January 14, 2019 19:28
User.php
<?php
namespace App;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Notifications\Notifiable;
use Orchid\Platform\Models\User as Authenticatable;
use Orchid\Screen\Fields\InputField;
class User extends Authenticatable implements MustVerifyEmail
@tabuna
tabuna / authInterceptorConfig.config.js
Created June 25, 2019 13:47 — forked from ygotthilf/authInterceptorConfig.config.js
AngularJS 1.x : send JWT and expired refresh token
// module is your angular module
module.config(authInterceptorConfig);
/* @ngInject*/
function authInterceptorConfig($httpProvider) {
$httpProvider.interceptors.push('authInterceptor');
}
module.factory('authInterceptor', authInterceptor);
@tabuna
tabuna / sajya-json-rpc.md
Last active May 8, 2020 19:19
Maybe an RPC-like API is better for your project?

JSON-RPC 2.0 this is a simple stateless protocol for creating an RPC (Remote Procedure Call) style API. It usually looks as follows:

You have one single endpoint on the server that accepts requests with a body of the form:

{"jsonrpc": "2.0", "method": "post.like", "params": {"post": "12345"}, "id": 1}

And it returns answers of the view:

@tabuna
tabuna / readme.md
Created July 20, 2020 18:05
It is not necessary to declare all fields every time

It is not necessary to declare all fields every time

Sometimes it bothers me to point out many fields to fill out, especially when the same fields are repeated (and this happens quite often), Collections can come to our aid.

Let's try to consider an example:

namespace App\Orchid\Layouts\Client;