當前位置: 首頁>>代碼示例>>PHP>>正文


PHP File::orderBy方法代碼示例

本文整理匯總了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'));
 }
開發者ID:victorfdt,項目名稱:theliteracycenter,代碼行數:12,代碼來源:FilesController.php

示例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));
 }
開發者ID:lialosiu,項目名稱:amaoto-core,代碼行數:9,代碼來源:FileController.php

示例3: getManage

 public function getManage(Request $request)
 {
     $files = File::orderBy('updated_at', 'desc')->paginate(15);
     return view("file.manage")->withFiles($files);
 }
開發者ID:ChenPeiyuan,項目名稱:student-infomation-manager,代碼行數:5,代碼來源:FileManageController.php

示例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']);
開發者ID:ChenPeiyuan,項目名稱:student-infomation-manager,代碼行數:31,代碼來源:routes.php


注:本文中的app\File::orderBy方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。