Skip to content

Instantly share code, notes, and snippets.

View mreduar's full-sized avatar

Eduar Bastidas mreduar

View GitHub Profile
@claudiodekker
claudiodekker / megapint.sh
Created June 22, 2022 22:48
Opinionated Laravel Pint alias. Prefers a repo-specific version of pint over a globally-installed one, and defaults to use the Laravel preset.
megapint() {
PINT=$([ -f "vendor/bin/pint" ] && echo "vendor/bin/pint" || echo "pint")
"$PINT" --preset laravel $@
}
@secrethash
secrethash / composer.json
Last active January 13, 2023 02:18
Laravel Helper Function to create a Unique slug based on Provided Model Instance. Save 'slugify_model.php' in your 'app/Helpers/' directory and update your composer.json to reference and autoload the helper function.
{
...
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
},
"files": [
...
@joelconty
joelconty / fix.sh
Last active June 20, 2023 22:00
This script fixes permissions and ownership of your laravel files. Save it on the root of your project, make it executable and edit only the two lines indicated at the beginning of the script to set your username and the name of the group used by your web server (usually www-data). Then just run with sudo ( sudo ./fix.sh ) and start coding!
#!/usr/bin/env bash
#Configure these two variables
MYUSER="joel"
APACHEGROUP="www-data"
#you don't need to edit anything below.
echo "Setting variables..."
@laravel-shift
laravel-shift / .php-cs-fixer.php
Last active April 9, 2024 14:08
PHP CS Fixer - Laravel Coding Style Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
@fzldn
fzldn / beautifier.js
Last active July 28, 2023 18:28
VS Code Laravel Blade formatter using extension Beautify 1.5.0 by HookyQR with js-beautify hacks
...
Beautifier.prototype.beautify = function() {
...
var source_text = this._source_text;
// BEGIN
source_text = source_text.replace(/\{\{(--)?((?:(?!(--)?\}\}).)+)(--)?\}\}/g, function(m, ds, c, dh, de) {
@ankurk91
ankurk91 / laravel_horizon.md
Last active May 9, 2024 14:05
Laravel Horizon, redis-server, supervisord on Ubuntu server

Laravel Horizon, redis-server, supervisord on Ubuntu 20/22 server

Laravel 8+, Horizon 5.x, Redis 6+

Parepare application

  • Install and configure Laravel Horizon as instructed in docs
  • Make sure you can access the Horizon dashboard like - http://yourapp.com/horizon
  • For now; it should show status as inactive on horizon dashbaord

Install redis-server

@paulund
paulund / phpcs.xml
Created August 20, 2017 16:50
PHP PSR-2 CodeSniffer Config for Laravel
<?xml version="1.0"?>
<ruleset name="Laravel Standards">
<!--
The name attribute of the ruleset tag is displayed
when running PHP_CodeSniffer with the -v command line
argument. The description tag below is not displayed anywhere
except in this file, so it can contain information for
developers who may change this file in the future.
-->
@sdrew
sdrew / Procfile
Last active July 27, 2021 15:25
Laravel configs for Heroku/Dokku
web: vendor/bin/heroku-php-apache2 public/
@mariotacke
mariotacke / README.md
Last active April 4, 2024 14:33
Spotify AutoHotkey Script

Spotify AutoHotkey Script

This script makes use of the Numpad to control media players and volume on your system.

Usage

  • Install AutoHotkey
  • Right-click .ahk script
  • Compile Script
  • Start executable

Hotkeys

@tao
tao / gist:fba880299bdfdcfd491582724ede9dd7
Last active September 11, 2023 14:29
Using Passport with Laravel Spark
# Installation
As far as I know this is how to get Passport on Laravel Spark working correctly, it works so far for me over the API but there might be something I am still missing.
I am using the following software versions in composer.json:
```
"require": {
"php": ">=5.6.4",
"laravel/framework": "5.3.*",