本文整理匯總了PHP中app\File::orderBy方法的典型用法代碼示例。如果您正苦於以下問題:PHP File::orderBy方法的具體用法?PHP File::orderBy怎麽用?PHP File::orderBy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app\File
的用法示例。
在下文中一共展示了File::orderBy方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
//Find all File
$files = File::orderBy('type', 'asc')->get();
//Send the your to the index page
return view('admin.file.index', compact('files'));
}
示例2: getFilesWithPaginate
public function getFilesWithPaginate(Request $request)
{
$perPage = $request->get('num');
if (!is_numeric($perPage) || $perPage < 1 || $perPage > 30) {
$perPage = 15;
}
$files = FileModel::orderBy('id', 'desc')->paginate($perPage);
return $this->buildResponse(trans('api.file.paginate.success'), Tools::toArray($files));
}
示例3: getManage
public function getManage(Request $request)
{
$files = File::orderBy('updated_at', 'desc')->paginate(15);
return view("file.manage")->withFiles($files);
}
示例4: function
Route::get('/home', function () {
return view('home');
});
Route::controllers([
'changepassword' => 'Auth\ChangePasswordController',
'log' => 'LogController',
'studentview' => 'StudentViewController',
]);
});
Route::group(['middleware' => 'admin'], function () {
Route::controllers([
'usermanage' => 'UserManageController',
'studentmanage' => 'StudentManageController',
]);
});
*/
use App\StudentManageLog;
use App\File;
Route::get('/', function () {
$pages = StudentManageLog::where("review", "0")->orderBy('created_at', 'desc')->paginate(15);
$files = File::orderBy('updated_at', 'desc')->take(15)->get();
return view('home')->withPages($pages)->withFiles($files);
});
Route::get('/home', function () {
$pages = StudentManageLog::where("review", "0")->orderBy('created_at', 'desc')->paginate(15);
$files = File::orderBy('updated_at', 'desc')->take(15)->get();
return view('home')->withPages($pages)->withFiles($files);
});
Route::controllers(['auth' => 'Auth\\AuthController', 'password' => 'Auth\\PasswordController', 'changepassword' => 'Auth\\ChangePasswordController', 'log' => 'LogController', 'studentview' => 'StudentViewController', 'usermanage' => 'UserManageController', 'studentmanage' => 'StudentManageController', 'countrymanage' => 'CountryManageController', 'excel' => 'PHPExcelController', 'tuition' => 'TuitionController', 'file' => 'FileManageController', 'statistic' => 'StatisticController', 'generate' => 'GenerateTableController', 'graduate' => 'GraduateController']);