Skip to content

Instantly share code, notes, and snippets.

View amochohan's full-sized avatar

Amo Chohan amochohan

View GitHub Profile
@amochohan
amochohan / 01_Laravel 5 Simple ACL manager_Readme.md
Last active November 8, 2023 21:03
Laravel 5 Simple ACL - Protect routes by an account / role type

#Laravel 5 Simple ACL manager

Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.

If the user has a 'Root' role, then they can perform any actions.

Installation

Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php

@amochohan
amochohan / reverse-string.php
Created September 24, 2014 11:35
Recurrsive function to reverse a string
<?php
function reverseString($string){
//Is this method being recurrsively called, i.e. do we still have part of the string being passed to the function to be reversed?
if(strlen($string)>1){
/*
* Return the last letter of the string, and append via calling this method again recursively (passing the remainder of the un-reversed string)
* to continue reversing the remainder of the string
*/