This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@foreach (array_slice($posts->toArray(), 0, 5) as $post) | |
<h1>{{ $post['title'] }}</h1> | |
@endforeach |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.selectize = this.$("#js-tags").selectize({ | |
persist: true, | |
maxItems: null, | |
valueField: "tag", | |
labelField: "tag", | |
searchField: ["tag"], | |
options: tags.toJSON(), // Backbone collection | |
render: { | |
item: function(item) { | |
return "<div><i class='icon-tag'></i> " + item.tag + "</div>"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Filter to check for CSRF attacks from the ajax requests. | |
*/ | |
Route::filter('csrf_header', function() | |
{ | |
if (Session::token() != Request::header('x-csrf-token')) | |
{ | |
throw new Illuminate\Session\TokenMismatchException; | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// DB Dumpers | |
DB::listen(function($sql) | |
{ | |
var_dump($sql); | |
}); | |
Event::listen('laravel.query', function($sql) | |
{ | |
var_dump($sql); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "laravel/laravel", | |
"description": "The Laravel Framework.", | |
"keywords": ["framework", "laravel"], | |
"license": "MIT", | |
"require": { | |
"laravel/framework": "4.1.*", | |
"components/bootstrap": "3.0.2" | |
}, | |
"require-dev": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -sS getcomposer.org/installer | php -d detect_unicode=Off | |
composer create-project laravel/laravel THE_PROJ_DIRECOTRY_NAME_YOU_WANT --prefer-dist | |
or using the new phar, copy it into usr/local/bin | |
run : | |
$ chmod +x /usr/local/bin/laravel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{link_to_route('routeName', 'Visible_Text_of_the_Laravel_Link');}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function install_laravel() { | |
echo "Installing Laravel into '$project_name'..." | |
wget https://github.com/laravel/laravel/archive/master.zip ./ | |
unzip ./master.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* @param unknown_type $form | |
* @param unknown_type $form_state | |
* @return multitype:string NULL | |
*/ | |
function multifiles_example_form($form, &$form_state) { | |
$form['#tree'] = TRUE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery.ajaxSetup({ | |
'beforeSend': function(xhr) {xhr.setRequestHeader("Accept", "text/javascript")} | |
}) | |
//Send data via get if JS enabled | |
jQuery.fn.getWithAjax = function() { | |
this.click(function() { | |
$.get($(this).attr("href"), $(this).serialize(), null, "script"); | |
return false; |