Skip to content

Instantly share code, notes, and snippets.

Avatar
🇧🇪
Never stop learning!

Ivan Vermeyen ivanvermeyen

🇧🇪
Never stop learning!
View GitHub Profile
@ivanvermeyen
ivanvermeyen / !NOTE.md
Last active Nov 30, 2021
Setup a Laravel Storage driver with Google Drive API
View !NOTE.md
@ivanvermeyen
ivanvermeyen / HOWTO.md
Last active Nov 19, 2021
Multiple MySQL versions on MacOS with Homebrew
View HOWTO.md

Update - 4 september 2020

Making multiple MySQL versions work with Homebrew was tricky to say the least. Fortunately there are 2 new easy ways that I learned of to achieve this.

DBngin app

As @4unkur and @henrytirla commented below, there is this extremely easy to use app called DBngin, which lets you setup multiple databases (not only MySQL) simultaneously using different ports:

https://dbngin.com/

@ivanvermeyen
ivanvermeyen / EnsureQueueListenerIsRunning.php
Last active Nov 19, 2021
Ensure that the Laravel queue listener is running with "php artisan queue:checkup" and restart it if necessary. You can run this automatically with a cron job: http://laravel.com/docs/scheduling
View EnsureQueueListenerIsRunning.php
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class EnsureQueueListenerIsRunning extends Command
{
/**
* The name and signature of the console command.
@ivanvermeyen
ivanvermeyen / Kernel.php
Created Jan 18, 2016
Find any running "queue:listen" processes for a Laravel project and kill those. Fire "php artisan queue:stop" in your "current" project root. Intended to use with a deploy script when you are using non-daemon listeners and deploy releases. If you are using daemons, run "queue:restart" instead. You can use a process monitoring tool like Superviso…
View Kernel.php
<?php
namespace App\Console;
use App\Console\Commands\StopQueueListeners;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
@ivanvermeyen
ivanvermeyen / error_blade_directive.php
Created Mar 29, 2019 — forked from calebporzio/error_blade_directive.php
A little Blade directive to make working with validation errors a bit nicer.
View error_blade_directive.php
<?php
// Usage:
// Before
@if ($errors->has('email'))
<span>{{ $errors->first('email') }}</span>
@endif
// After:
@ivanvermeyen
ivanvermeyen / webpack.mix.js
Created Mar 19, 2019 — forked from calebporzio/webpack.mix.js
A webpack.mix.js file for writing NPM packages the way you write JS in a Laravel app.
View webpack.mix.js
let mix = require('laravel-mix');
mix.js('src/index.js', 'dist/foo.js').sourceMaps();
mix.webpackConfig({
output: {
libraryTarget: 'umd',
}
})
@ivanvermeyen
ivanvermeyen / Vessel.md
Last active Dec 19, 2018
Docker Project Setup with Vessel
View Vessel.md
@ivanvermeyen
ivanvermeyen / LocalValetDriver.php
Created Jun 30, 2017
Custom Valet Driver (place in project root)
View LocalValetDriver.php
<?php
class LocalValetDriver extends ValetDriver
{
private $site_folder = '/public';
/**
* Determine if the driver serves the request.
*
View SecureToken.php
<?php
/**
* Generate a secure token.
*
* @url http://stackoverflow.com/questions/18910814/best-practice-to-generate-random-token-for-forgot-password
*/
function generateToken($length = 40)
{
return bin2hex(random_bytes($length));
View ValidateSometimes.php
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class SomeRequest extends FormRequest
{
/**
* Validate conditional rules.
*