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


PHP Course::stripes方法代碼示例

本文整理匯總了PHP中app\Course::stripes方法的典型用法代碼示例。如果您正苦於以下問題:PHP Course::stripes方法的具體用法?PHP Course::stripes怎麽用?PHP Course::stripes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\Course的用法示例。


在下文中一共展示了Course::stripes方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: generateRandomString

        do {
            $rnd = generateRandomString(5);
        } while (Course::where('u_identifier', '=', $rnd)->first() != NULL);
        $course->u_identifier = $rnd;
        $course->name = $course_installer->name;
        $course->description = $course_installer->description;
        $course->maxStudentsPerStripe = $course_installer->maxStudentsPerStripe;
        $course->single_stripe = $course_installer->single_stripe;
        $course->referents = $course_installer->referents;
        $course->save();
        for ($c = 0; $c < 9; $c++) {
            if (intval($course_installer->{itoa($c + 1)}) != 0) {
                $stripe = new Stripe();
                $stripe->stripe_number = $c + 1;
                $stripe->stripe_call = $course_installer->{itoa($c + 1)};
                $course->stripes()->save($stripe);
            }
        }
    }
    return redirect(route("admin"))->withSuccess("Corsi importati con successo.");
}]);
// ------
// Authentication routes
Route::get('/', ['as' => 'auth.getLogin', 'uses' => 'Auth\\AuthController@getLogin']);
Route::post('auth/login', ['as' => 'auth.postLogin', 'uses' => 'Auth\\AuthController@postLogin']);
Route::get('auth/logout', ['as' => 'auth.logout', 'uses' => 'Auth\\AuthController@getLogout']);
// Registration routes
Route::get('auth/register', ['as' => 'auth.getRegister', 'uses' => 'Auth\\AuthController@getRegister']);
Route::post('auth/register', 'Auth\\AuthController@postRegister');
// SIGNUP - QUIT
Route::post('/courses/{course_id}/signup/', function ($course_id) {
開發者ID:H3xept,項目名稱:SettimanaFlessibile,代碼行數:31,代碼來源:routes.php

示例2: quitStripes

 public function quitStripes(Course $course, $stripe_numbers)
 {
     foreach ($stripe_numbers as $stripe_number) {
         $this->stripes()->detach($course->stripes()->where('stripe_number', '=', $stripe_number)->first()->id);
     }
 }
開發者ID:H3xept,項目名稱:SettimanaFlessibile,代碼行數:6,代碼來源:User.php


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