Defining Eloquent model (will assume that DB table named is set as plural of class name and primary key named "id"):
class Shop extends Eloquent {}
Using custom table name
protected $table = 'my_shops';
<?php | |
namespace App\Http\Middleware; | |
use Closure; | |
use Illuminate\Http\Request; | |
use Illuminate\Http\Response; | |
use Symfony\Component\DomCrawler\Crawler; | |
class PjaxMiddleware |
/* ========================================================= | |
* My way to safely display external pictures | |
* ========================================================= | |
* Copyright 2015 Leonan Carvalho @leonancarvalho | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 |
[ | |
{ | |
"args": null, | |
"command": "find_under_expand" | |
}, | |
{ | |
"args": | |
{ | |
"by": "words", |
[ | |
{ | |
"command": "escape" | |
}, | |
{ | |
"command": "expand_selection", | |
"args": {"to": "word"} | |
}, | |
{ | |
"command": "copy" |
#!/usr/bin/env bash | |
echo ">>> Starting Install Script" | |
# Update | |
sudo apt-get update | |
# Install MySQL without prompt | |
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root' | |
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root' |
/* | |
<a href="posts/2" data-method="delete"> <---- We want to send an HTTP DELETE request | |
- Or, request confirmation in the process - | |
<a href="posts/2" data-method="delete" data-confirm="Are you sure?"> | |
*/ | |
(function() { |
// Clone L4 repo | |
git clone -b develop git://github.com/laravel/laravel.git myapp | |
cd myapp | |
// Install Composer | |
curl -sS https://getcomposer.org/installer | php | |
php composer.phar install | |
// Rename origin | |
git remote rename origin upstream |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
/*! | |
* jQuery TextChange Plugin | |
* http://www.zurb.com/playground/jquery-text-change-custom-event | |
* | |
* Copyright 2010, ZURB | |
* Released under the MIT License | |
*/ | |
(function ($) { | |
$.event.special.textchange = { |