本文整理汇总了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']);