Я использую этот контроллер, чтобы получить разрешение пользователям там проектов < /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
Как фильтровать данные таблицы в соответствии с Auth :: user-> id (); в Ларавеле ⇐ Php
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Auth::check() и Auth::attempt() возвращают false на сервере для определенной таблицы
Anonymous » » в форуме Php - 0 Ответы
- 19 Просмотры
-
Последнее сообщение Anonymous
-