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


PHP Organization::where方法代码示例

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


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

示例1: function

    Route::resource('iterations', 'IterationsController');
    //Route::resource('task', 'TaskController');
    Route::resource('personalType', 'PersonalTypeController');
});
Route::group(['prefix' => 'messages'], function () {
    Route::get('/', ['as' => 'messages', 'uses' => 'MessagesController@index']);
    Route::get('create', ['as' => 'messages.create', 'uses' => 'MessagesController@create']);
    Route::post('/', ['as' => 'messages.store', 'uses' => 'MessagesController@store']);
    Route::get('{id}', ['as' => 'messages.show', 'uses' => 'MessagesController@show']);
    Route::put('{id}', ['as' => 'messages.update', 'uses' => 'MessagesController@update']);
});
Route::get('users/delete', function () {
    if (Request::ajax()) {
        $id = Input::get("id");
        $user = User::findOrFail($id);
        $organizations = sizeof(Organization::where('usersid', '=', $id)->get());
        if ($organizations >= 1) {
            return Response::json(array('succes' => 'false', 'message' => 'No se puede borrar el registro. <br />El usuario es propietario de una organización'));
        }
        if ($user->delete()) {
            return Response::json(array('succes' => 'true', 'message' => 'Usuario eliminado exitosamente', 'gr' => $user->organization()));
        } else {
            return Response::json(array('succes' => 'false', 'message' => 'Error, claves foráneas'));
        }
    }
});
Route::controller('projects', 'ProjectsController');
Route::controller('users', 'UsersController');
Route::get('/', 'UsersController@getLogin');
Route::post('update/{id}', 'UsersController@update');
Route::get('edit/{id}', 'GraphicsController@iterationSummary');
开发者ID:josimarjimenez,项目名称:architects,代码行数:31,代码来源:routes.php

示例2: function

    Route::get('sign-in', ['as' => 'sign-in', 'uses' => 'SessionsController@create']);
    Route::post('sign-in', ['as' => 'sign-in', 'uses' => 'SessionsController@store']);
    Route::get('sign-up', ['as' => 'sign-up', 'uses' => 'SignupsController@create']);
    Route::post('sign-up', ['as' => 'sign-up', 'uses' => 'SignupsController@store']);
});
Route::group(['domain' => 'toodoo.dev', 'before' => 'auth'], function () {
    Route::get('/', ['uses' => 'HomeController@show', 'as' => 'home']);
    Route::get('dashboard', ['uses' => 'HomeController@dashboard', 'as' => 'dashboard']);
    Route::delete('sign-out', ['as' => 'sign-out', 'uses' => 'SessionsController@destroy']);
});
Route::group(['domain' => '{organizations}.toodoo.dev', 'before' => 'auth|tenant'], function () {
    Route::get('/', ['uses' => 'OrganizationsController@show', 'as' => 'organizations.show']);
    Route::get('settings', ['uses' => 'OrganizationsController@edit', 'as' => 'settings']);
    Route::put('settings', ['uses' => 'OrganizationsController@update', 'as' => 'settings']);
    Route::bind('organizations', function ($value, $route) {
        return Organization::where('slug', $value)->firstOrFail();
    });
    Route::resource('todos', 'TodosController');
    // Will remove for manual routes maybe?
    Route::model('todos', 'Todo');
    Route::resource('users', 'UsersController');
    Route::model('users', 'User');
    Route::get('styles/organization-custom.css', function (Organization $org) {
        $response = Response::make(View::make('organizations.css', ['css' => $org->css]));
        $response->header('Content-Type', 'text/css');
        return $response;
    });
});
View::composer('shared._notifications', function ($view) {
    $view->with('flash', ['success' => Session::get('success'), 'error' => Session::get('error')]);
});
开发者ID:sonico999,项目名称:Multitenant-Apps-in-Laravel,代码行数:31,代码来源:routes.php

示例3: load_organizations

 public function load_organizations()
 {
     $country_id = $_POST['country_id'];
     $data = new Organization();
     if ($country_id > 0) {
         $data->where('country_id', $country_id);
     }
     $data->get();
     echo '<select name="org_id" class="form-control">';
     echo '<option value="">-- select organization --</option>';
     foreach ($data as $key => $data_item) {
         echo '<option value="' . $data_item->id . '">' . $data_item->org_name . '</option>';
     }
     echo '</select>';
 }
开发者ID:ultraauchz,项目名称:asean_cultural_mapping,代码行数:15,代码来源:organizations.php

示例4: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $event = VolunteerEvent::find($id);
     $organizations = Organization::where('user_id', '=', Auth::user()->id)->lists('id', 'name');
     return View::make('events.edit', compact('event', 'organizations'));
 }
开发者ID:thehelpster,项目名称:helpster,代码行数:12,代码来源:EventsController.php

示例5: function

<?php

/*
|--------------------------------------------------------------------------
| Application & Route Filters
|--------------------------------------------------------------------------
|
| Below you will find the "before" and "after" events for the application
| which may be used to do any work before or after a request into your
| application. Here you may also register your custom route filters.
|
*/
App::before(function ($request) {
    App::singleton('organization', function () {
        $organization = Organization::where('name', 'Arquinova')->get()->first();
        $organization->auxName = str_replace(" ", '-', $organization->name);
        foreach ($organization->projects as $project) {
            $project->auxName = str_replace(" ", '-', $project->name);
            $project->auxName = stripAccents($project->auxName);
        }
        return $organization;
    });
    App::bind('foo', function ($app) {
        return new FooBar();
    });
    View::share('organization', app('organization'));
});
/**
 * Replace accents 
 **/
function stripAccents($str)
开发者ID:josimarjimenez,项目名称:architects,代码行数:31,代码来源:filters.php

示例6: array

        default:
            $object = '';
    }
    return Response::json($object);
}));
Route::post('{object_name}/search/json', array('as' => 'search', function ($object_name) {
    if (!Input::has('query')) {
        return Response::json(array());
    }
    $query = Input::get('query', '');
    $query = '%' . str_replace(' ', '%', $query) . '%';
    switch ($object_name) {
        case 'user':
            $results = User::where('email', 'LIKE', $query)->orWhere('first_name', 'LIKE', $query)->get()->toArray();
            foreach ($results as $key => $user) {
                $full_name = $user['first_name'] . ' ' . substr($user['last_name'], 0, 1);
                $results[$key]['name'] = $full_name;
                unset($results[$key]['last_name']);
            }
            break;
        case 'organization':
            $results = Organization::where('name', 'LIKE', $query)->get();
            break;
        default:
            $results = array();
    }
    return Response::json($results);
}));
// CREATE FILTERS TO DETERMINE WHAT AUTHENTICATION IS NEEDED
// FOR EXAMPLE, ANY ROUTE WITH /edit IN THE NAME REQUIRES AT LEAST
// EDIT PERMISSIONS
开发者ID:omusico,项目名称:lafayettehelps.com,代码行数:31,代码来源:routes.php


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