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
<?php | |
/** | |
* 前準備 | |
* 1.Composer をインストールする(https://getcomposer.org/doc/00-intro.md) | |
* 2.Guzzle をインストール | |
{ | |
"require": { | |
"guzzle/guzzle": "dev-master" | |
} |
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
<?php | |
/* | |
|-------------------------------------------------------------------------- | |
| アプリケーションルート | |
|-------------------------------------------------------------------------- | |
| | |
| このファイルでアプリケーションの全ルートを定義します。 | |
| 方法は簡単です。対応するURIをLaravelに指定してください。 | |
| そしてそのURIに対応する実行コードをクロージャーで指定します。 |
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
<?php | |
class User extends Eloquent implements UserInterface, RemindableInterface { | |
// 新たに追加されたメソッドを実装すべし | |
/** | |
* Get the token value for the "remember me" session. | |
* | |
* @return string | |
*/ | |
public function getRememberToken() | |
{ |
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
<?php | |
use Illuminate\Database\Migrations\Migration; | |
use Illuminate\Database\Schema\Blueprint; | |
class AddRememberTokenToUserTable extends Migration | |
{ | |
/** | |
* Run the migrations. |
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
# special thanks | |
# http://www.02.246.ne.jp/~torutk/java/install/jdk7onwindows7.html | |
# | |
# | |
# Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. | |
# ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. | |
# | |
# | |
# | |
# |
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
<?php | |
namespace Backlog; | |
use GuzzleHttp\Client; | |
class XmlRpcSample | |
{ | |
protected $url; | |
protected $user; |
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
<?php | |
Route::get('dompdf', function() | |
{ | |
// 前準備として load_font.php で描画に必要なフォントを読み込ませる。 | |
define("DOMPDF_ENABLE_AUTOLOAD", false); | |
require_once base_path() . "/vendor/dompdf/dompdf/dompdf_config.inc.php"; | |
$domPdf = new DOMPDF(); | |
$domPdf->load_html(View::make('pdf')); | |
$domPdf->set_paper('A4'); |
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
<?php | |
Route::get('show', function() | |
{ | |
$article = ['id' => 1, 'title' => "today's dialy", 'content' => "It's a sunny day."]; | |
return Response::json($article); | |
}); | |
Route::post('edit', function() | |
{ |
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
<?php | |
Route::get('dir', function() | |
{ | |
return View::make('dir'); | |
}); | |
Route::post('dir', function() | |
{ | |
$v = Validator::make(Input::all(), ['name' => 'required']); | |
if ($v->fails()) { |
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
<?php | |
Route::get('api/members{ext?}', function($ext = null) | |
{ | |
if (is_null($ext)) { | |
$ext = 'view'; | |
} | |
$ext = ltrim($ext, '.'); | |
// ここはちょっと考える必要あるかも | |
// View の切り替えをしたい場合は View::make がいいかもしれません | |
return Response::$ext('test'); |