A curated list of amazingly awesome PHP libraries, resources and shiny things.
- Composer/Packagist - A package and dependency manager.
- Composer Installers - A multi framework Composer library installer.
<?php | |
/** | |
* | |
* Make the string of a defined length | |
* | |
* @param string $string | |
* @param integer $max_length | |
* @param boolean $trunc_at_space | |
* @param string $replacement |
<?php | |
/** | |
* | |
* Creates nicely formated timestamps | |
* | |
* @param timestamp $date | |
* @return string | |
*/ | |
public static function get_x_time_ago($date) |
### Laravel ### | |
app/config/dev/ | |
bootstrap/compiled.php | |
.env.*.php | |
.env.php | |
### Composer ### | |
composer.phar | |
vendor/ |
A curated list of amazingly awesome PHP libraries, resources and shiny things.
server { | |
listen 80; | |
listen [::]:80; | |
server_name site.com; | |
root /home/forge/site.com; | |
# FORGE SSL (DO NOT REMOVE!) | |
# ssl on; | |
# ssl_certificate; | |
# ssl_certificate_key; |
#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.
Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php
Elasticsearch require Java, so we will install that now. We will install a recent version of Oracle Java 8 because that is what Elasticsearch recommends. It should, however, work fine with OpenJDK, if you decide to go that route.
Add the Oracle Java PPA to apt
:
* sudo add-apt-repository -y ppa:webupd8team/java
Update your apt
package database:
<a href="javascript:void(0)" class="backtotop">Back to Top</a> | |
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'></script> | |
<script type='text/javascript'> jQuery('.backtotop').click(function(){ jQuery('html, body').animate({scrollTop:0}, 'slow'); }); </script> |
#!/bin/bash | |
echo "Please, enter your username, it will be added to 'sudo' and 'docker' groups during the process." | |
read USERNAME | |
if [ -z "$USERNAME" ] ; then | |
echo "Exiting... Done." | |
exit | |
else | |
echo "Adding user to 'sudo' group..." |