Skip to content

Instantly share code, notes, and snippets.

View warrickbayman's full-sized avatar

Warrick Bayman warrickbayman

View GitHub Profile
@warrickbayman
warrickbayman / PasswordInput.vue
Created March 19, 2019 05:33
Simple Vue password input component.
<template>
<div class="input-group password-input">
<input type="hidden" :name="name" v-model="password" />
<input type="password" class="form-control" v-model="password" v-if="!visible" />
<input type="text" class="form-control" v-model="password" v-else />
<div class="input-group-append">
<button class="btn btn-outline-dark" type="button" @click.prevent="toggleVisibility">
<i class="material-icons">
<template v-if="visible">visibility</template>
@warrickbayman
warrickbayman / SlugService.php
Created February 18, 2019 20:39
A simple class to help in the generation of slug for Laravel models
<?php
namespace App\Services;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;
/**
* Class SlugService
@warrickbayman
warrickbayman / DevelopmentServiceProvider.php
Last active October 25, 2016 20:42
Laravel: Load development only packages
<?php
namespace App\Providers;
use Illuminate\Foundation\AliasLoader;
use Illuminate\Support\ServiceProvider;
class DevelopmentServiceProvider extends ServiceProvider
{
protected $providers = [
@warrickbayman
warrickbayman / Repository.php
Last active February 2, 2017 07:06
Simple Laravel 5 repositories (PHP 7+)
<?php
namespace App\Repositories;
use App\Repositories\Contracts\RepositoryInterface;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
/**
* Class UserRepository