Как фильтровать данные таблицы в соответствии с Auth :: user-> id (); в ЛаравелеPhp

Кемеровские программисты php общаются здесь
Anonymous
Как фильтровать данные таблицы в соответствии с Auth :: user-> id (); в Ларавеле

Сообщение Anonymous »

Я использую этот контроллер, чтобы получить разрешение пользователям там проектов < /p>

public function show($id)
{
if (Permission::where('status', 1)->where('project_id', $id)->exists()) {
// if((Permission::where('status', '=', '1')->first()) && (Permission::where('project_id','=',$id)->first())){
$project = Project::find($id);
$tasks = $this->getTasks($id);
$files = $this->getFiles($id);
$comments = $this->getComments($id);
$collaborators = $this->getCollaborators($id);
$permissions = $this->getPermissions($id);
returnview('collaborators.show')->withProject($project)->withTasks($tasks)->withFiles($files)->withComments($comments)->withCollaborators($collaborators);
}
else if
//return('hi');
(Permission::where('status', 2)->where('project_id', $id)->exists()) {
$project = Project::find($id);
$tasks = $this->getTasks($id);
$files = $this->getFiles($id);
$comments = $this->getComments($id);
$collaborators = $this->getCollaborators($id);
$permissions = $this->getPermissions($id);
return view('collaborators.manager')->withProject($project)->withTasks($tasks)->withFiles($files)->withComments($comments)->withCollaborators($collaborators);
}
< /code>

Моя модель разрешения - < /p>



Подробнее здесь: https://stackoverflow.com/questions/409 ... in-laravel

Вернуться в «Php»