Skip to content

Instantly share code, notes, and snippets.

@michalkolek
michalkolek / Auth.md
Created December 1, 2019 20:05 — forked from jimgwhit/Auth.md

Anyone new to RBAC I highly suggest using laravel's or Spatie https://github.com/spatie/laravel-permission

However being familiar with RBAC I use built in authentication but have custom authorization.

I use static helper classes, but instance will also work. And these are just simple examples of making sure a required role of a method matches with one of the logged in users role.

I have a role field in users table like:

   role 
@michalkolek
michalkolek / nginx-gzip.conf
Created October 17, 2019 10:39 — forked from kilhage/nginx-gzip.conf
Enables gzip compression for common mime types in nginx
gzip on;
# most people include something like this. don't.
# check your default nginx.conf, it's already covered in a much better way.
#gzip_disable "MSIE [1-6]\.(?!.*SV1)";
# compress proxied requests too.
# it doesn't actually matter if the request is proxied, we still want it compressed.
gzip_proxied any;