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
/* {{{ | |
Copyright (c) 2008, anekos. | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without modification, | |
are permitted provided that the following conditions are met: | |
1. Redistributions of source code must retain the above copyright notice, | |
this list of conditions and the following disclaimer. | |
2. Redistributions in binary form must reproduce the above copyright notice, |
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 | |
return [ | |
'twitter' => [ | |
'client_id' => env('TWITTER_CLIENT_ID'), | |
'client_secret' => env('TWITTER_CLIENT_SECRET'), | |
'redirect' => 'http://127.0.0.1:8000/auth/twitter/callback', | |
], | |
]; |
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('/', function () { | |
if (!Auth::check()) { | |
// ログイン済でなければリダイレクト | |
$url = url('auth/twitter'); | |
$text = 'twitter でログイン'; | |
return 'こんにちは ゲストさん. ' . '<a href="' . $url . '">' . $text . '</a>'; | |
} |
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 Application", | |
"dependencies": { | |
"bootstrap-sass-official": "~3.3.1", | |
"font-awesome": "~4.2.0" | |
} | |
} | |
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
### Sample Settings | |
# aliases | |
# in this example you can open extensions page by the command ':ext' | |
# and Chrome's option page by the command ':option' | |
alias ext TabOpenNew chrome://extensions/ | |
alias option TabOpenNew chrome://settings/browser | |
alias downloads TabOpenNew chrome://downloads | |
alias history TabOpenNew chrome://history |
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('/', function() | |
{ | |
return 'Hello 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
<?php | |
return array( | |
// 'username' => 'Username', | |
'username' => 'ユーザー名', | |
// 'password' => 'Password', | |
'password' => 'パスワード', | |
// 'password_confirmation' => 'Confirm Password', | |
'password_confirmation' => 'パスワードの確認', |
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 | |
// env == local の場合 noindex, nofollow する | |
HTML::macro('follow', function() { | |
if (App::environment() === 'local') { | |
return PHP_EOL . '<meta name="robots" content="noindex,nofollow" />'; | |
} | |
return ''; | |
}); | |
// 配列を分解して keywords にセット | |
HTML::macro('keywords', function($keywords) { |
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::post('save', function() { | |
$user = new User; | |
$user->username = 'foo'; | |
$user->password = Hash::make('password'); | |
$user->email = 'foo@bar.com'; | |
DB::transaction(function() use ($user) { | |
$user->save(); | |
}); |
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 | |
App::before(function($request) | |
{ | |
// POST / PUT / DELETE / PATCH also included You can use the $request-> getRealMethod() | |
if ($request->getMethod() === 'POST') { | |
Route::callRouteFilter('csrf', [], '', $request); | |
} | |
}); |