This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Turn all URLs in clickable links. | |
* | |
* @param string $value | |
* @param array $protocols http/https, ftp, mail, twitter | |
* @param array $attributes | |
* @return string | |
*/ | |
public function linkify($value, $protocols = array('http', 'mail'), array $attributes = array()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//return an array of objects according to key, value, or key and value matching | |
function getObjects(obj, key, val) { | |
var objects = []; | |
for (var i in obj) { | |
if (!obj.hasOwnProperty(i)) continue; | |
if (typeof obj[i] == 'object') { | |
objects = objects.concat(getObjects(obj[i], key, val)); | |
} else | |
//if key matches and value matches or if key matches and value is not passed (eliminating the case where key matches but passed value does not) | |
if (i == key && obj[i] == val || i == key && val == '') { // |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Providers; | |
use Illuminate\Support\Collection; | |
use Illuminate\Pagination\LengthAwarePaginator; | |
class AppServiceProvider extends ServiceProvider | |
{ | |
public function boot() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.randomize = function (selector) { | |
var $elems = selector ? $(this).find(selector) : $(this).children(), | |
$parents = $elems.parent(); | |
$parents.each(function () { | |
$(this).children(selector).sort(function (childA, childB) { | |
// * Prevent last slide from being reordered | |
if($(childB).index() !== $(this).children(selector).length - 1) { | |
return Math.round(Math.random()) - 0.5; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Change to the project directory | |
cd $FORGE_SITE_PATH | |
# Turn on maintenance mode | |
php artisan down || true | |
# Pull the latest changes from the git repository | |
# git reset --hard | |
# git clean -df | |
git pull origin $FORGE_SITE_BRANCH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div x-data="setupEditor(@entangle($attributes->wire('model')).defer)" x-init="() => init($refs.editor)" wire:ignore | |
{{ $attributes->whereDoesntStartWith('wire:model')->merge(['class' => 'editor !w-full !max-w-full']) }}> | |
<template x-if="editor"> | |
<div class="flex space-x-4 items-center dark:text-neutral-100 fill-current py-2"> | |
<button @click.prevent="Alpine.raw(editor).chain().toggleBold().focus().run()"> | |
<x-icon-bold class="w-4 h-4" /> | |
</button> | |
<button @click.prevent="Alpine.raw(editor).chain().toggleItalic().focus().run()"> | |
<x-icon-italic class="w-4 h-4" /> | |
</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Providers; | |
use Illuminate\Support\ServiceProvider; | |
class AppServiceProvider extends ServiceProvider | |
{ | |
public function register() | |
{ |