Skip to content

Instantly share code, notes, and snippets.

View PgSqlNativeQueryCursor.php
namespace AppBundle\Doctrine;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Driver\PDOPgSql\Driver as PDOPgSqlDriver;
use Doctrine\ORM\NativeQuery;
class PgSqlNativeQueryCursor
amochohan / 01_Laravel 5 Simple ACL
Last active Feb 11, 2022
Laravel 5 Simple ACL - Protect routes by an account / role type
View 01_Laravel 5 Simple ACL

#Laravel 5 Simple ACL manager

Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.

If the user has a 'Root' role, then they can perform any actions.


Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php

Kartones /
Last active May 26, 2022
PostgreSQL command line cheatsheet


Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)