@extends('admin.layouts.app')
@section('title','Edit Paper Authors')
@section('page-title','Edit Paper Authors')
@section('page-subtitle',$paper->paper_code)
@section('content')
@if($errors->any())
@foreach($errors->all() as $e)- {{ $e }}
@endforeach
@endif
@php
$principal = $paper->authors->firstWhere('author_order', 1) ?? $paper->authors->first();
$coAuthors = $paper->authors->where('author_order', '>', 1)->sortBy('author_order')->values()->map(fn ($a) => [
'first_name' => $a->first_name,
'other_name' => $a->other_name,
'last_name' => $a->last_name,
'email' => $a->email,
'phone' => $a->phone,
'affiliation' => $a->affiliation,
])->all();
@endphp
@endsection