- 2024/04/29
- Category :
[PR]
×
[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。
ステップアップしていくブログです。
[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。
// Controller $row = User::find(1); // View {{{$row->birthday->format('Y年m月d日')}}}
/** * Get the attributes that should be converted to dates. * * @return array */ public function getDates() { $defaults = array(static::CREATED_AT, static::UPDATED_AT); return array_merge($this->dates, $defaults); }
class User extends Eloquent { protected $dates = ['birthday']; ... }
{{{$row->birthday->format('Y年m月d日')}}}
$sql = DB::table('user')->where('name', '=', '一郎')->toSql();
select * from `user` where `name` = ?
$sql = User::where('name', '=', '一郎')->toSql();
$ php artisan route
+--------+-------------------------------------------------------------------------------+--------+----------------------------------------+----------------------+---------------+ | Domain | URI | Name | Action | Before Filters | After Filters | +--------+-------------------------------------------------------------------------------+--------+----------------------------------------+----------------------+---------------+ | | GET|HEAD login | | LoginController@index | | | | | POST login | login | LoginController@login | csrf | log | | | GET|HEAD logout | logout | LoginController@logout | log | |