View drop_all_tables_in_postgresql.php
<?php
// Select all tables from the database
$tables = DB::select("SELECT tablename FROM pg_catalog.pg_tables WHERE schemaname='public'");
// Get array of just the table names
$tables = array_column($tables, 'tablename');
// Loop through and drop each table
// The "cascade" option is important otherwise foreign keys constraints will fail
View TrimMiddleware.php
<?php
namespace ChurchSocial\Middleware;
use Closure;
class TrimMiddleware
{
public function handle($request, Closure $next)
{
View NullMiddleware.php
<?php
namespace ChurchSocial\Middleware;
use Closure;
class NullMiddleware
{
public function handle($request, Closure $next)
{
View classes.md

By type

  • /Controllers
  • /Events
  • /Models

By topic

  • /Comments
  • /Posts
View example.php
<?php
$periods = [
[new DateTime('8AM'), new DateTime('5PM')], // 9 hours
[new DateTime('8AM'), new DateTime('5PM')], // 9 hours
[new DateTime('10AM'), new DateTime('12PM')], // 2 hours
[new DateTime('12PM'), new DateTime('5PM')], // 5 hours
[new DateTime('7PM'), new DateTime('8PM')], // 1 hour
[new DateTime('9AM'), new DateTime('4PM')], // 7 hours
];
View .env
APP_ENV=local
APP_DEBUG=true
View nginx_cache_busting.conf
location ~* '\.(?:jpg|jpeg|gif|png|ico|gz|svg|svgz|mp4|ogg|ogv|webm|htc|css|js|ttf|ttc|otf|eot|woff)$'
{
expires 1y;
add_header Cache-Control "public";
add_header "Cache-Control" "no-transform";
location ~* '(.+)\.(?:\d+)\.(js|css|png|jpg|jpeg|gif)$'
{
try_files $uri $1.$2;
}
View .htaccess
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)\.(\d+)\.(css|gif|jpeg|jpg|js|png|svg)$ $1.$3 [L]
</IfModule>
View phantomjs.sh
# Go to home folder
cd ~
# Download file
wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2
# Extract
tar -xvf phantomjs-1.9.7-linux-x86_64.tar.bz2
# Copy phantomjs to bin folder
View gist:11162546
apt-get install wkhtmltopdf
apt-get install xvfb
echo 'xvfb-run --server-args="-screen 0, 1024x768x24" /usr/bin/wkhtmltopdf $*' > /usr/bin/wkhtmltopdf.sh
chmod a+x /usr/bin/wkhtmltopdf.sh
ln -s /usr/bin/wkhtmltopdf.sh /usr/local/bin/wkhtmltopdf
wkhtmltopdf http://www.google.com output.pdf