mirror of
https://github.com/10h30/Test-Laravel-File-Upload.git
synced 2026-06-05 15:07:47 +09:00
Completed all tasks
This commit is contained in:
@@ -11,11 +11,12 @@ class ProjectController extends Controller
|
||||
{
|
||||
$request->validate([
|
||||
// TASK: Write the validation rule so "logo" file would be MAX 1 megabyte
|
||||
'logo' => 'max:1024',
|
||||
]);
|
||||
|
||||
// TASK: change the below line so that $filename would contain only filename
|
||||
// The same filename as the original uploaded file
|
||||
$filename = '???';
|
||||
$filename = $request->file('logo')->getClientOriginalName();
|
||||
$request->file('logo')->storeAs('logos', $filename);
|
||||
|
||||
Project::create([
|
||||
|
||||
Reference in New Issue
Block a user