0
有以下代碼:我如何掛鉤的方法在laravel分貝
$data = DB::table('blogs')
->where('title', '=', $title);
現在,我想它已經如上初始化後添加更多的方法。我想在下面添加一些內容,以便將其他位置添加到數據中。
$input = TRUE;
$data = DB::table('blogs')
->where('title', '=', $title);
if($input){
$data->where('description','=', $description); //but then, this doesn't work
}
我想添加更多,如果就像orderby
,where
內。但是,它不起作用。 這樣做的正確方法是什麼?感謝
噢耶..謝謝@meera – smzapp