This file contains hidden or 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
//at view blade, must put data-remote | |
{!! Form::open(array('data-remote','url' => 'notices/'.$notice->id, 'method' => 'PATCH')) !!} | |
//js | |
$(function() { | |
var submitAjaxRequest = function(e){ |
This file contains hidden or 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
<script type="text/javascript" src="{{ URL::asset('js/jquery.js') }}"></script> | |
<script type="text/javascript" src="{{ URL::asset('css/style.js') }}"></script> |
This file contains hidden or 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
<?php | |
/* | |
1. Use method injection | |
*/ | |
//use the namespace | |
use Illuminate\Contracts\Auth\Guard; | |
public function confirm(Guard $auth) |
This file contains hidden or 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
<?php | |
namespace App\Http\Requests; | |
use App\Http\Requests\Request; | |
class AdminUsersRequest extends Request | |
{ | |
/** | |
* Determine if the user is authorized to make this request. |
This file contains hidden or 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
<?php | |
class MY_Controller extends CI_Controller | |
{ | |
protected $data = array(); | |
function __construct() | |
{ | |
parent::__construct(); |
This file contains hidden or 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
//things to do after clone angular project | |
npm install | |
bower install | |
grunt wiredep | |
grunt server | |
//check version of all installed bower packages | |
bower list --json=0 --offline | |
//update angular version using bower |
This file contains hidden or 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
git checkout -b tier1234 origin/tier1234 |
This file contains hidden or 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
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
use App\Product; | |
//create form | |
public function create() |
This file contains hidden or 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
{!! Form::open(['route' => 'tickets.store','class' => 'form-horizontal', 'files' => true]) !!} | |
{!! Form::label('state_id', 'State') !!} | |
{!! Form::text('product_name','',['class'=>'form-control']); !!} | |
{!! Form::radio('condition', 'new', true); !!} New | |
{!! Form::radio('condition', 'used', false); !!} Used | |
{!! Form::select('state_id', $states, null, ['placeholder' => 'Select State','class'=>'form-control','id'=>'state_id']); !!} |
This file contains hidden or 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
<?php | |
public function index(Request $request) { | |
$posts = new Post; | |
//if have relationship, use this code below to initialize Post | |
//$posts = Post::with('user','category'); | |
//kalau ada search by title, filter posts by title |
OlderNewer