Getting started:
Related tutorials:
public function index(){ | |
$categoryList = Category::all(); | |
return view('category.list')->with('categoryList', $categoryList); | |
} |
<?php | |
/** | |
* Over-ridden the register method from the "RegistersUsers" trait | |
* Remember to take care while upgrading laravel | |
*/ | |
public function register(Request $request) | |
{ | |
// Laravel validation | |
$validator = $this->validator($request->all()); |
Getting started:
Related tutorials:
jQuery(function($) { | |
$('form[data-async]').live('submit', function(event) { | |
var $form = $(this); | |
var $target = $($form.attr('data-target')); | |
$.ajax({ | |
type: $form.attr('method'), | |
url: $form.attr('action'), | |
data: $form.serialize(), |
FILE SPACING: | |
# double space a file | |
sed G | |
# double space a file which already has blank lines in it. Output file | |
# should contain no more than one blank line between lines of text. | |
sed '/^$/d;G' |
amitava@bonjovi:~$ sudo virsh | |
Welcome to virsh, the virtualization interactive terminal. | |
Type: 'help' for help with commands | |
'quit' to quit | |
virsh # start latticegrid-demo | |
Domain latticegrid-demo started | |
virsh # list |
class Ticket < ActiveRecord::Base | |
SEARCH_COLUMNS = { | |
:tickets => [:token, :subject, :body, :customer_name, :customer_email], | |
:notes => [:body, :author_name, :author_email] | |
} | |
def self.conditions_for_keyword_search(table, keywords) | |
# Because we may use this string elsewhere, we don't want to mutate the only copy | |
query_words = keywords.dup |
<?php | |
/** | |
* Get first paragraph from a WordPress post. Use inside the Loop. | |
* | |
* @return string | |
*/ | |
function get_first_paragraph(){ | |
global $post; | |
$str = wpautop( get_the_content() ); |
@ECHO OFF | |
REM Set default sock file | |
SET SSH_AUTH_SOCK=/tmp/ssh-agent.sock | |
REM Check socket is available | |
IF NOT EXIST "%TMP%\ssh-agent.sock" GOTO:RUNAGENT | |
REM Check if an ssh-agent is running | |
FOR /f "tokens=*" %%I IN ('ps ^| grep ssh-agent ^| sed "s/^ *\([0-9]\+\) .*/\1/"') DO SET VAR=%%I |
webpack.mix.js
file in root directory:const { mix } = require('laravel-mix');
mix.js('resources/assets/js/app.js', 'public/js')
.sass('resources/assets/sass/app.scss', 'public/css');
/* Optional: uncomment for bootstrap fonts */
// mix.copy('node_modules/bootstrap-sass/assets/fonts/bootstrap/','public/fonts/bootstrap');