Skip to content

Instantly share code, notes, and snippets.

@matticustard
matticustard / Pagination.vue
Last active November 26, 2019 23:43
Updated vue-pagination component
<template>
<nav>
<ul class="pagination" v-if="pagination.last_page > 0" :class="sizeClass">
<li class="page-item" v-if="showPrevious()" :class="{ 'disabled' : pagination.current_page <= 1 }">
<a href="#" class="page-link" v-if="pagination.current_page > 1 " :aria-label="config.ariaPrevioius" @click.prevent="changePage(pagination.current_page - 1)">
<span aria-hidden="true">{{ config.previousText }}</span>
</a>
</li>
<li class="page-item" v-for="num in array" :class="{ 'active' : num === pagination.current_page }">
<?php
namespace App\Http\Controllers;
use App\Model;
use Illuminate\Http\Request;
class ModelController extends Controller
{
/**
@matticustard
matticustard / hash-check.php
Created August 13, 2019 15:57
Simple Laravel hash check
$password = '123123';
$hash_1 = Hash::make($password);
$hash_2 = bcrypt($password);
dd([
Hash::check($password,$hash_1), // true
Hash::check($password,$hash_2), // true
]);
@matticustard
matticustard / App.vue
Last active July 13, 2019 23:08
Laravel Vue Sample for StackOverflow user
<template>
<div>
<!-- Display results -->
<h1 v-for="(result, index) in results">
Result {{ result.id }} name: {{ result.name }}
</h1>
<!-- End Display results -->
</div>
@matticustard
matticustard / sample.html
Created February 12, 2019 23:40
Simple example: Show or hide secondary paragraph by clicking a link (requires jQuery).
<p>
Your visible text.
</p>
<a id="toggle_text" href="#!">More...</a>
<p id="hidden_text" style="display: none;">
Your hidden text.
</p>
@matticustard
matticustard / wa-events-custom.css
Last active April 23, 2018 04:50
Custom event styles for MNPS
#id_Header1 {
padding: 30px !important;
margin-top: 20px !important;
border-radius: 5px;
}
#id_9e8UAry {
padding: 15px !important;
border-radius: 5px;
}