View AppServiceProvider.php
<?php
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
use Illuminate\Database\Query\Builder as QueryBuilder;
use Illuminate\Database\Query\Expression;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
public function boot()
View validation_macros.php
<?php
Request::macro('validate', function ($rules, $messages = [], $customAttributes = []) {
$this->lastValidated = array_keys($rules);
(new class() {
use ValidatesRequests;
})->validate($this, $rules, $messages, $customAttributes);
});
View RememberQueryStrings.php
<?php
namespace App\Http\Middleware;
use Closure;
class RememberQueryStrings
{
public function handle($request, Closure $next)
{
View User.php
<?php
namespace App;
use App\Scopes\WithSelects;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
class User extends Authenticatable
{
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