Skip to content

Instantly share code, notes, and snippets.

@kicco
kicco / ReadOnly.php
Created April 12, 2016 15:35
Laravel ReadOnly model (PHP 5.3 compatible)
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class ReadOnly extends Model
{
/**
* Indicates if the model should be timestamped.
*
* @var bool
*/
@kicco
kicco / ReadOnlyTrait.php
Created April 12, 2016 15:37
Laravel ReadOnly Trait
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
Trait ReadOnly
{
/**
* Indicates if the model should be timestamped.
@kicco
kicco / redis.service
Created July 22, 2017 19:14
Redis 4.0 Systemd Ubunutu 16.04
[Unit]
Description=Redis In-Memory Data Store
After=network.target
[Service]
User=redis
Group=redis
Type=forking
LimitNOFILE=64000
ExecStart=/usr/local/bin/redis-server /etc/redis/redis.conf
@kicco
kicco / HasPrymaryUuidTrait.php
Created July 22, 2017 19:17
Laravel 5.4 UuidTrait instead on incrementing id
<?php
namespace App;
use Ramsey\Uuid\Uuid;
trait HasPrimaryUUID
{
protected static function boot()
{