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';
| /* globals module, require */ | |
| module.exports = function (grunt) { | |
| "use strict"; | |
| grunt.initConfig({ | |
| pkg: grunt.file.readJSON("package.json"), | |
| jshint: { |
| <div class="form-horizontal"> | |
| <div class="form-group"><label class="control-label col-md-3">Full Name</label><div class="col-md-9">[text* your-name class:form-control]</div></div> | |
| <div class="form-group"><label class="control-label col-md-3">Email Address</label><div class="col-md-9">[email* your-email class:form-control]</div></div> | |
| <div class="form-group"><label class="control-label col-md-3">Subject</label><div class="col-md-9">[text your-subject class:form-control]</div></div> | |
| <div class="form-group"><label class="control-label col-md-3">Message</label><div class="col-md-9">[textarea your-message x5 class:form-control]</div></div> | |
| <div class="form-group"><div class="col-md-offset-3 col-md-9">[submit class:btn class:btn-primary "Send"]</div></div> | |
| </div> |
| /* | |
| ========================================================================== | |
| Import Bootstrap Stuff | |
| ========================================================================== | |
| */ | |
| /* Core variables and mixins */ | |
| @import "less/variables.less"; | |
| @import "less/mixins/vendor-prefixes.less"; | |
| @import "less/mixins/alerts.less"; |
| /* | |
| ========================================================================== | |
| Import Bootstrap Stuff | |
| ========================================================================== | |
| */ | |
| /* Core variables and mixins */ | |
| @import "less/variables.less"; | |
| @import "less/mixins/vendor-prefixes.less"; | |
| @import "less/mixins/alerts.less"; |
| <?php | |
| /* * ** | |
| * | |
| * This script converts an existing MySQL database to migrations in Laravel 4. | |
| * | |
| * 1. Place this file inside app/controllers/ | |
| * | |
| * 2. In this file, edit the index() method to customize this script to your needs. | |
| * - inside $migrate->ignore(), you pass in an array of table |
| # Nginx FastCGI Cache: http://seravo.fi/2013/optimizing-web-server-performance-with-nginx-and-php | |
| # More Caching: https://www.digitalocean.com/community/tutorials/how-to-setup-fastcgi-caching-with-nginx-on-your-vps | |
| # Apache Bench Mac: http://kevify.com/2013/ab-on-mac/ | |
| fastcgi_cache_path /var/cache/nginx levels=1:2 keys_zone=MYAPP:100m inactive=60m; | |
| fastcgi_cache_key "$scheme$request_method$host$request_uri"; | |
| server { | |
| listen 80; |
| <?php | |
| class Post | |
| { | |
| protected $table = 'posts'; | |
| /** | |
| * You can define your own custom boot method. | |
| * | |
| * @return void | |
| **/ |
| <?php | |
| /** | |
| * Display a thumbnail from YouTube based off the embed code saved in the | |
| * video post format metabox used by the CF Post Formats plugin | |
| * | |
| * @link https://github.com/crowdfavorite/wp-post-formats | |
| * @link http://stackoverflow.com/a/6382259 | |
| */ | |
| global $post; |