Skip to content

Instantly share code, notes, and snippets.

<?php
class BaseModel extends Eloquent
{
public $timestamps = false;
/**
* Validation rules
*
* @var array
//Creating a Registration Form
//Laravel has ability to use a different route for get and post without going to a different page
// Ideally the default value of field "remember_token" in "users" table should be "Null", if you get an error
// Hash::make() is a Laravel function which implements security on password & needs 128 length in db table
// To Create a Form, use below code in 'register.blade.php'
http://stackoverflow.com/questions/19386962/laravel-eloquent-and-complex-relationships?rq=1
http://forumsarchive.laravel.io/viewtopic.php?pid=21255
http://stackoverflow.com/questions/20666490/laravel-4-mssql-stored-procedure-with-parameters-as-a-prepared-statements
http://culttt.com/2013/08/05/extending-eloquent-in-laravel-4/
http://www.blogosfera.co.uk/2013/08/pass-parameters-in-insert-query-stored-procedure-in-laravel-4/
//Javascript
$(function()
{
var BASE_URL = window.location.protocol + '//' + window.location.host;
$("#buttonselector").click(function() {
var data = {
'inputelementname' : $('#inputelementselector').val(),
};
http://stackoverflow.com/questions/19386962/laravel-eloquent-and-complex-relationships?rq=1
http://forumsarchive.laravel.io/viewtopic.php?pid=21255
http://stackoverflow.com/questions/20666490/laravel-4-mssql-stored-procedure-with-parameters-as-a-prepared-statements
http://culttt.com/2013/08/05/extending-eloquent-in-laravel-4/
http://www.blogosfera.co.uk/2013/08/pass-parameters-in-insert-query-stored-procedure-in-laravel-4/
<?php
# Instead of
$name = 'Jeff';
switch ($name) {
case 'Jeff':
echo "I'm Jeff";
break;
case 'Joe':
presentation
.title('My Great Presentation')
.slide({
title: 'Learn About Borders',
bullets: [
'Thing 1',
'Thing 2',
],
code: ['path/to/file.css', [2,4]] // path to file, lines to grab
$(window).scroll(function() {
var scroll = $(window).scrollTop();
if (scroll > 50) {
$(".menu-bar").addClass("menu-bar-scroll");
} else {
$(".menu-bar").removeClass("menu-bar-scroll");
}
});
(function(){
/*
<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() {
$(document).ready(function() {
// Add click handler to hyperlinks to send restful DELETE requests
//
// Example:
//
// <a href="/delete/1" class="rest-delete">delete</a>
// <script>restful.init($('.rest-delete'));</script>
//
var restful = {