public function deleteFile($id) { FileUpload::find($id)->delete(); return Redirect::to("/dashboard/storyteller/manage/files"); }
{{$upload->createdBy->username}} </td> <td> {{$upload->updated_at->diffForHumans()}} </td> </tr> @endforeach </tbody> </table> <a href="/dashboard/storyteller/manage/files/new"> <button class="button success">New File</button> </a> @else <?php $file = isset($id) ? FileUpload::find($id) : null; ?> <h2>Upload a New File</h2> <form method="post" action="/dashboard/storyteller/manage/files/upload" enctype="multipart/form-data"> <div class="row"> <div class="small-2 columns"> <label for="name" class="inline right">Name</label> </div> <div class="small-10 columns"> <input type="text" name="name" value="{{$file ? $file->name : ''}}" /> </div> </div> <div class="row"> <div class="small-2 columns"> <label for="permission" class="inline right">Read Permission</label> </div>