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
//echo get_chinese_weekday(‘2014-05-26 00:11:12’); | |
public function get_chinese_weekday($datetime) | |
{ | |
$weekday = date('w', strtotime($datetime)); | |
$weeklist = array('日', '一', '二', '三', '四', '五', '六'); | |
return '星期' . $weeklist[$weekday]; | |
} | |
public function get_number_weekday($datetime) |
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
public function youtube_views($url) | |
{ | |
$api_key = "Your_Api_for_youtube"; | |
$count = viewCount //viewCount,likeCount,dislikeCount,favoriteCount,commentCount | |
parse_str( parse_url( $url, PHP_URL_QUERY ), $my_array_of_vars ); | |
$video_ID = $my_array_of_vars['v']; | |
$url_content = "https://www.googleapis.com/youtube/v3/videos?id={$video_ID}&key={$api_key}&part=statistics"; | |
$ch = curl_init(); |
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
try { | |
DB::connection('pgsql')->getPdo()->beginTransaction(); | |
DB::connection('pgsql')->getPdo()->commit(); | |
} catch (\PDOException $e) { | |
DB::connection('pgsql')->getPdo()->rollBack(); | |
} |
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
class MeetController extends Controller | |
{ | |
public function store() | |
{ | |
$v = Validator::make(request()->all(), Meets::rules()); | |
if($v->fails()) { | |
#return error | |
} | |
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
Route.php | |
$app->get('member/{member_id}','MemberController@show'); | |
--------- | |
MemberController.php | |
public function show(Request $request , $member_id) | |
{ | |
$request['member_id'] = $member_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
-- ---------------------------- | |
-- Table structure for country_codes | |
-- ---------------------------- | |
DROP TABLE IF EXISTS "public"."country_codes"; | |
CREATE TABLE "public"."country_codes" ( | |
"id" int4 NOT NULL DEFAULT nextval('country_codes_id_seq'::regclass), | |
"country" varchar(255) NOT NULL COLLATE "default", | |
"dialing_code" int4 NOT NULL, | |
"country_code" varchar(255) NOT NULL COLLATE "default" | |
) |
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
3340:Buy,1036:Buy,2003:StartHpPot,1027:Buy,1004:Buy,3070:Buy,1037:Buy,3004:Buy,1001:Buy,2003:StopHpPot,3044:Buy,3057:Buy,3101:Buy,3078:Buy,1053:Buy,3144:Buy,1043:Buy,3153:Buy,3006:Buy,3087:Buy,3046:Buy |
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
`....```` ` ```` `` .` | |
.`.````` ` .. | |
.`` `` .. .. | |
.` ` `..` -. | |
`` ` `` `````` ` .` | |
` ` ```````````` .` `. | |
` . ``-` . |
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
$s3 = \Illuminate\Support\Facades\Storage::disk('s3'); | |
$bucket = 'eatgether'; | |
# Get dir Files | |
$files = $s3->allFiles('news'); | |
$client = $s3->getDriver()->getAdapter()->getClient(); | |
$expiry = "+10 minutes"; | |
$result = []; |
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
建立一個新的 Provider | |
<?php | |
namespace App\Providers; | |
use Illuminate\Database\Eloquent\Builder; | |
use Illuminate\Support\ServiceProvider; |
OlderNewer