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
$user = User::find(10); | |
$profile = $user->UserProfile ?: new UserProfile; | |
$profile->name = 'Steven'; | |
$user->UserProfile()->save($profile); |
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
CREATE TABLE table LIKE original_table; | |
INSERT INTO table SELECT * FROM original_table; |
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
package com.mtigdemir; | |
import java.io.IOException; | |
import javax.servlet.http.*; | |
import com.google.appengine.api.channel.ChannelMessage; | |
import com.google.appengine.api.channel.ChannelService; | |
import com.google.appengine.api.channel.ChannelServiceFactory; | |
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
$(document).on('click', 'a[href^="#"]', function(e) { | |
// target element id | |
var id = $(this).attr('href'); | |
// target element | |
var $id = $(id); | |
if ($id.size() === 0) { | |
return; | |
} |
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
$(document).ajaxStart(function () { | |
$(".loading").show(); | |
}); | |
$(document).ajaxComplete(function () { | |
$(".loading").hide(); | |
}); |
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
// SET THE input old value with following values Input::old('key'); | |
Session::set('_old_input.key', Input::get('value')); |
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
$("#textarea").keyup(function(){ | |
$("#count").text("Characters left: " + (500 - $(this).val().length)); | |
}); |
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
$messageBag = new Illuminate\Support\MessageBag; | |
$messageBag->add('error' , 'My Message'); | |
Redirect::back()->withErrors($messageBag); |
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
Redirect::back()->with('tab' , 'tab-photos'); |
OlderNewer