本文整理匯總了PHP中app\Book::cheap方法的典型用法代碼示例。如果您正苦於以下問題:PHP Book::cheap方法的具體用法?PHP Book::cheap怎麽用?PHP Book::cheap使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app\Book
的用法示例。
在下文中一共展示了Book::cheap方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: function
Route::get('whereIn', function () {
dd(Book::whereIn('title', ['My First Book', 'My Second Book'])->get());
});
/**
* Magic where
* Using PHP Magic methos a dynamically create where methods on table columns
* Only valid when checking equal values
*/
Route::get('magicWhere', function () {
dd(Book::wherePagesCount(230)->first());
});
/**
* Query scopes
* Defined in Book model
*/
Route::get('cheap', function () {
dd(Book::cheap(11)->get());
});
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/
Route::group(['middleware' => ['web']], function () {
//
});