@php $memberIds = $project->members->pluck('user_id')->toArray(); @endphp @if ( $editRatingPermission == 'all' || ($editRatingPermission == 'added' && $project->rating->added_by == user()->id) || ($editRatingPermission == 'owned' && (in_array(user()->id, $memberIds) || $project->client_id == user()->id)) || ($editRatingPermission == 'both' && (in_array(user()->id, $memberIds) || $project->client_id == user()->id || $project->rating->added_by == user()->id)) || in_array('client', user_roles()) ) (!is_null($project->rating) || ($addRatingPermission == 'none') && is_null($project->rating))])>
{{-- raing id here --}} rating)) value="{{ $project->rating->id }}" @endif>
@if (is_null($project->deleted_at))
@lang('app.save')
@endif
@endif
@if (!is_null($project->rating)) @if ( $viewRatingPermission == 'all' || ($viewRatingPermission == 'added' && $project->rating->added_by == user()->id) || ($viewRatingPermission == 'owned' && (in_array(user()->id, $memberIds) || $project->client_id == user()->id)) || ($viewRatingPermission == 'both' && (in_array(user()->id, $memberIds) || $project->client_id == user()->id || $project->rating->added_by == user()->id)) )

{{ nl2br($project->rating->comment) }}

{{ $project->client->name }}, {{ $project->rating->created_at->diffForHumans() }}
@if ( is_null($project->deleted_at) && $editRatingPermission == 'all' || ($editRatingPermission == 'added' && $project->rating->added_by == user()->id) || ($editRatingPermission == 'owned' && (in_array(user()->id, $memberIds) || $project->client_id == user()->id)) || ($editRatingPermission == 'both' && (in_array(user()->id, $memberIds) || $project->client_id == user()->id || $project->rating->added_by == user()->id)) || in_array('client', user_roles()) ) @lang('app.edit') @endif @if ( is_null($project->deleted_at) && $deleteRatingPermission == 'all' || ($deleteRatingPermission == 'added' && $project->rating->added_by == user()->id) || ($deleteRatingPermission == 'owned' && (in_array(user()->id, $memberIds) || $project->client_id == user()->id)) || ($deleteRatingPermission == 'both' && (in_array(user()->id, $memberIds) || $project->client_id == user()->id || $project->rating->added_by == user()->id)) || in_array('client', user_roles()) ) @lang('app.delete') @endif
@else @endif @else @endif