本文整理汇总了PHP中app\Project::count方法的典型用法代码示例。如果您正苦于以下问题:PHP Project::count方法的具体用法?PHP Project::count怎么用?PHP Project::count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Project
的用法示例。
在下文中一共展示了Project::count方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
$count = Employee::count();
$countProj = Project::count();
$data = Employee::all();
$YourRole = "";
if (count(Auth::user()) > 0) {
$YourRole = Auth::user()->UserRoles->role;
}
$Role2 = $this->Role1;
// Count Unconfirmed
$cc = 0;
foreach ($data as $da) {
if ($da->confirm == 0) {
$cc++;
}
}
$countConf = $cc;
// Count Confirmed
$cc1 = 0;
foreach ($data as $dat) {
if ($dat->confirm == 1) {
$cc1++;
}
}
$countConfirmed = $cc1;
View::share('countConf', $countConf);
View::share('YourRole', $YourRole);
View::share('countConfirmed', $countConfirmed);
View::share('count', $count);
View::share('countProj', $countProj);
}
示例2: index
public function index()
{
\App\Gini\Gapper\Client::init();
if (\App\Gini\Gapper\Client::getUserName()) {
return view('dashboard', ['products_count' => Product::count(), 'servers_count' => Server::count(), 'clients_count' => Client::where('parent_id', 0)->count(), 'projects_count' => Project::count()]);
}
return view('login');
}
示例3: index
public function index()
{
// 사용자, 프로젝트, 태스트 수 가져오기
$uc = User::count();
$pc = Project::count();
$tc = Task::count();
$total = ['user' => $uc, 'project' => $pc, 'task' => $tc];
// 뷰에 전달
return view('main')->with('total', $total);
}
示例4: showDashboard
public function showDashboard()
{
$projects = new Project();
$projectCount = $projects->count();
$published = $projects->where('published', 1)->count();
$unpublished = $projects->where('published', 0)->count();
$illustrations = Illustration::count();
$logos = Logo::count();
return view('dashboard/dashboard', compact('projectCount', 'published', 'unpublished', 'illustrations', 'logos'));
}
示例5: composeDashboard
private function composeDashboard()
{
view()->composer('admin.index', function ($view) {
$numArticle = \App\Article::count();
$numCategory = \App\Category::count();
$numTag = \App\Tag::count();
$numProject = \App\Project::count();
$numMessage = \App\Message::count();
$view->with(compact('numArticle', 'numCategory', 'numTag', 'numProject', 'numMessage'));
});
}
示例6: __construct
public function __construct()
{
$count = Employee::count();
$countProj = Project::count();
$data = Employee::all();
$DataEm = "";
$YourRole = "";
$undisplayRoleAcc = "";
if (count(Auth::user()) > 0) {
$YourRole = Auth::user()->UserRoles->role;
if (Auth::user()->id_employees > 0) {
$DataEm = Employee::where('id', Auth::user()->id_employees)->get();
}
}
if ($YourRole == 11) {
$undisplayRoleAcc = "undisplayRole";
}
$Role2 = $this->Role1;
// Count Unconfirmed
$cc = 0;
foreach ($data as $da) {
if ($da->confirm == 0) {
$cc++;
}
}
$countConf = $cc;
// Count Confirmed
$cc1 = 0;
foreach ($data as $dat) {
if ($dat->confirm == 1) {
$cc1++;
}
}
$countConfirmed = $cc1;
View::share('countConf', $countConf);
View::share('DataEm', $DataEm);
View::share('undisplayRoleAcc', $undisplayRoleAcc);
View::share('YourRole', $YourRole);
View::share('countConfirmed', $countConfirmed);
View::share('count', $count);
View::share('countProj', $countProj);
}
示例7: function
Route::get('logout', ['as' => 'logout', 'uses' => 'LogController@logout']);
/*Routes Residente*/
Route::group(['namespace' => 'Resident', 'prefix' => 'resident', 'middleware' => ['auth']], function () {
Route::get('home', ['as' => 'home', 'uses' => 'HomeController@getHome']);
Route::post('proyecto/avance', ['as' => 'residente.proyecto.avance', 'uses' => 'AvanceController@avanceProyecto']);
Route::post('proyecto/avance/add', ['as' => 'residente.avance.add', 'uses' => 'AvanceController@addAvance']);
Route::get('last/advanced', ['as' => 'residente.avance.last', 'uses' => 'AvanceController@last']);
Route::get('users', ['as' => 'residente.users', 'uses' => 'AvanceController@users']);
Route::get('all', ['as' => 'residente.all', 'uses' => 'AvanceController@all']);
Route::resource('advanced', 'AvanceController');
});
/*Routes admin*/
Route::group(['namespace' => 'Admin', 'prefix' => 'admin', 'middleware' => ['auth', 'admin']], function () {
Route::get('home', function () {
$residents = \App\Resident::where('type', '<>', 'admin')->count();
$projects = \App\Project::count();
$beneficiaries = \App\Beneficiary::count();
$disenos = \App\Desing::count();
return view('admin.home', compact('projects', 'residents', 'beneficiaries', 'disenos'));
});
Route::post('delete/stage/project', ['as' => 'detele.staage.project', 'uses' => 'ProjectController@deleteStageProject']);
Route::get('opciones/proyecto', ['as' => 'option.project', 'uses' => 'ProjectController@opciones']);
Route::post('etapas/proyecto', ['as' => 'admin.project.stage', 'uses' => 'ProjectController@stageProject']);
Route::post('all/stage', ['uses' => 'ProjectController@allStage']);
Route::post('nothing/stage', ['uses' => 'ProjectController@nothingStage']);
Route::post('etapas/proyecto/dos', ['as' => 'admin.add.stage.project', 'uses' => 'ProjectController@stageProjectAdd']);
Route::resource('proyectos', 'ProjectController');
Route::post('benficiarios/cambiar/proyecto/', ['as' => 'admin.beneficiarios.change-project', 'uses' => 'BeneficiarioController@changeProject']);
Route::get('beneficiario/project/{id}', ['as' => 'admin.project.beneficiario', 'uses' => 'BeneficiarioController@directBen']);
Route::post('residente/change/project/', ['as' => 'admin.residentes.change-project', 'uses' => 'ResidenteController@changeProject']);
Route::get('residente/project/{id}', ['as' => 'admin.project.residente', 'uses' => 'ResidenteController@directRe']);
示例8: getTotalCountOfProjects
public function getTotalCountOfProjects()
{
return Project::count();
}
示例9: isEmpty
/**
* Returns whether or not any entries exist.
*
* @return bool
*/
public function isEmpty()
{
return Project::count() == 0;
}