Skip to content

Instantly share code, notes, and snippets.

View ivanvermeyen's full-sized avatar
🇧🇪
Never stop learning!

Ivan Vermeyen ivanvermeyen

🇧🇪
Never stop learning!
View GitHub Profile
@ivanvermeyen
ivanvermeyen / error_blade_directive.php
Created March 29, 2019 09:46 — forked from calebporzio/error_blade_directive.php
A little Blade directive to make working with validation errors a bit nicer.
<?php
// Usage:
// Before
@if ($errors->has('email'))
<span>{{ $errors->first('email') }}</span>
@endif
// After:
@ivanvermeyen
ivanvermeyen / webpack.mix.js
Created March 19, 2019 17:51 — forked from calebporzio/webpack.mix.js
A webpack.mix.js file for writing NPM packages the way you write JS in a Laravel app.
let mix = require('laravel-mix');
mix.js('src/index.js', 'dist/foo.js').sourceMaps();
mix.webpackConfig({
output: {
libraryTarget: 'umd',
}
})
@ivanvermeyen
ivanvermeyen / HOWTO.md
Last active January 14, 2024 03:02
Multiple MySQL versions on MacOS with Homebrew

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 / Vessel.md
Last active December 19, 2018 11:32
Docker Project Setup with Vessel
@ivanvermeyen
ivanvermeyen / LocalValetDriver.php
Created June 30, 2017 16:04
Custom Valet Driver (place in project root)
<?php
class LocalValetDriver extends ValetDriver
{
private $site_folder = '/public';
/**
* Determine if the driver serves the request.
*
<?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));
@ivanvermeyen
ivanvermeyen / !NOTE.md
Last active March 15, 2023 05:25
Setup a Laravel Storage driver with Google Drive API
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class SomeRequest extends FormRequest
{
/**
* Validate conditional rules.
*
@ivanvermeyen
ivanvermeyen / BlogController.php
Created March 27, 2016 15:19 — forked from tobysteward/BlogController.php
Laravel AJAX Pagination with JQuery
<?php
class BlogController extends Controller
{
/**
* Posts
*
* @return void
*/
public function showPosts()
@ivanvermeyen
ivanvermeyen / Kernel.php
Created January 18, 2016 23:45
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…
<?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
{