当前位置: 首页>>代码示例>>PHP>>正文


PHP Skill::all方法代码示例

本文整理汇总了PHP中Skill::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Skill::all方法的具体用法?PHP Skill::all怎么用?PHP Skill::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Skill的用法示例。


在下文中一共展示了Skill::all方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $opportunity = $this->opportunity->find($id);
     $locations = Location::lists('location_name', 'id');
     $group = Opportunity::find($id);
     $skills = Skill::all();
     $assigned = $group->skills->lists('id');
     if (is_null($opportunity)) {
         return Redirect::route('opportunities.index');
     }
     return View::make('opportunities.edit', compact('opportunity', 'locations', 'group', 'skills', 'assigned'));
 }
开发者ID:jewelhuq,项目名称:volunteer-app,代码行数:18,代码来源:OpportunitiesController.php

示例2: showWelcome

 public function showWelcome()
 {
     if (Sentry::check()) {
         $user = Sentry::getUser();
         $group = User::find($user->id);
         $skills = Skill::all();
         $assigned = $group->skills->lists('id');
         $user_object = User::find($user->id);
         $locations = Location::all();
         $location_assigned = $group->locations->lists('id');
         //for an oppurtunity if and skills match then check against location
         $skillmatches = Skill::with('opportunities')->with('users')->has('opportunities')->has('users')->get();
         //if the oppurtunity and location match send email and display in Matches on feed
         $events = Community_event::all();
         //array to store docs without tags
         $usermatches = User::with('locations')->has('locations')->get();
         $opportunitymatches = Opportunity::with('location')->with('skills')->get();
         return View::make('hello', compact('skillmatches', 'opportunitymatches', 'skills', 'assigned', 'locations', 'location_assigned', 'events'));
     } else {
         return View::make('hello');
     }
 }
开发者ID:jewelhuq,项目名称:volunteer-app,代码行数:22,代码来源:HomeController.php

示例3: function

                $job->name = $app->request->post('title');
                $job->description = $app->request->post('description');
                $job->youtube = $urlvars['v'];
                $job->educationLevel()->associate($edu_level);
                $job->talent()->associate($talent);
                $job->save();
                $data['new_occupation'] = $job;
            }
        }
        $app->render('occupations/edit.html', $data);
    })->via('GET', 'POST')->name('occupations_edit');
});
$app->group('/skills', function () use($app, $data) {
    $data['request_method'] = $app->request->getMethod();
    $app->get('/', function () use($app, $data) {
        $data['skills'] = Skill::all();
        $app->render('skills/overview.html', $data);
    })->name('skills_overview');
    $app->map('/delete/:id', function ($id) use($app, $data) {
        $data['skill'] = Skill::find($id);
        if ($app->request->isPost()) {
            $data['skill']->delete();
        }
        $app->render('skills/delete.html', $data);
    })->via('GET', 'POST')->name('skills_delete');
    $app->map('/new', function () use($app, $data) {
        if ($app->request->isPost()) {
            $edu_level = EducationLevel::find($app->request->post('educationlevel'));
            $skill = new Skill();
            $skill->name = $app->request->post('title');
            $skill->save();
开发者ID:Robinwist,项目名称:UXDTalentenTest,代码行数:31,代码来源:admin.php

示例4: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $skills = $this->skill->all();
     return View::make('skills.index', compact('skills'));
 }
开发者ID:jewelhuq,项目名称:volunteer-app,代码行数:10,代码来源:SkillsController.php

示例5: function

});
$app->get('/schooladvice', function () use($app) {
    $app->response()->header('Content-Type', 'application/json');
    echo EducationLevel::SchoolAdvice()->get()->toJson();
});
$app->get('/schools', function () use($app) {
    $app->response()->header('Content-Type', 'application/json');
    echo School::all()->toJson();
});
$app->get('/skills', function () use($app) {
    $app->response()->header('Content-Type', 'application/json');
    echo Skill::all()->toJson();
});
$app->get('/occupation', function () use($app) {
    $app->response()->header('Content-Type', 'application/json');
    echo Skill::all()->toJson();
});
$app->group('/user', function () use($app) {
    $app->options('/:name', function ($name) use($app) {
        $app->response()->header('Access-Control-Allow-Methods', 'PUT, GET, POST, DELETE, OPTIONS');
    });
    $app->options('/', function () use($app) {
        $app->response()->header('Access-Control-Allow-Methods', 'PUT, GET, POST, DELETE, OPTIONS');
    });
    $app->options('/progress', function () use($app) {
        $app->response()->header('Access-Control-Allow-Methods', 'GET, OPTIONS');
    });
    $app->options('/talent/:name', function () use($app) {
        $app->response()->header('Access-Control-Allow-Methods', 'PUT, GET, POST, DELETE, OPTIONS');
    });
    $app->options('/occupation', function () {
开发者ID:Robinwist,项目名称:UXDTalentenTest,代码行数:31,代码来源:api.php

示例6: getEdit

 /**
  *  Edit / Update User Profile
  */
 public function getEdit($id)
 {
     try {
         //Get the current user's id.
         Sentry::check();
         $currentUser = Sentry::getUser();
         //Do they have admin access?
         if ($currentUser->hasAccess('admin')) {
             $group = User::find($id);
             $skills = Skill::all();
             $assigned = $group->skills->lists('id');
             $user_object = User::find($id);
             $locations = Location::all();
             $location_assigned = $group->locations->lists('id');
             $cities = City::orderBy('city_name')->lists('city_name', 'city_name');
             $data['user'] = Sentry::getUserProvider()->findById($id);
             $data['userGroups'] = $data['user']->getGroups();
             $data['allGroups'] = Sentry::getGroupProvider()->findAll();
             return View::make('users.edit')->with($data)->with('cities', $cities)->with('skills', $skills)->with('assigned', $assigned)->with('locations', $locations)->with('location_assigned', $location_assigned);
         } elseif ($currentUser->getId() == $id) {
             $group = User::find($id);
             $skills = Skill::all();
             $assigned = $group->skills->lists('id');
             $user_object = User::find($id);
             $locations = Location::all();
             $location_assigned = $group->locations->lists('id');
             $cities = City::orderBy('city_name')->lists('city_name', 'city_name');
             $data['user'] = Sentry::getUserProvider()->findById($id);
             $data['userGroups'] = $data['user']->getGroups();
             return View::make('users.edit')->with($data)->with('cities', $cities)->with('skills', $skills)->with('group', $group)->with('assigned', $assigned)->with('locations', $locations)->with('location_assigned', $location_assigned);
         } else {
             Session::flash('error', 'You don\'t have access to that user.');
             return Redirect::to('/');
         }
     } catch (Cartalyst\Sentry\UserNotFoundException $e) {
         Session::flash('error', 'There was a problem accessing your account.');
         return Redirect::to('/');
     }
 }
开发者ID:jewelhuq,项目名称:volunteer-app,代码行数:42,代码来源:UserController.php

示例7: array

/*
|-----------------------------------------------------------------------
| Locations
|-----------------------------------------------------------------------
*/
Route::resource('locations', 'LocationsController');
/*
|-----------------------------------------------------------------------
| Opportunities
|-----------------------------------------------------------------------
*/
Route::resource('opportunities', 'OpportunitiesController');
Route::post('/user/{id}/add', array('as' => 'skills.add', 'uses' => 'SkillsController@useradd'));
Route::group(array('prefix' => 'v1'), function () {
    Route::get('skills', function () {
        $skills = Skill::all();
        return Response::json($skills->toArray(), 201);
    });
    Route::get('opportunities', function () {
        $opportunities = Opportunity::all();
        return Response::json($opportunities->toArray(), 201);
    });
    Route::get('skill-matches', function () {
        $skillmatches = Skill::with('opportunities')->with('users')->has('opportunities')->has('users')->get();
        return Response::json($skillmatches->toArray(), 201);
    });
    Route::get('opportunity-matches', function () {
        $opportunitymatches = Opportunity::with('location')->with('skills')->get();
        return Response::json($opportunitymatches->toArray(), 201);
    });
    Route::get('community-events', function () {
开发者ID:jewelhuq,项目名称:volunteer-app,代码行数:31,代码来源:routes.php


注:本文中的Skill::all方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。