Skip to content

Commit

Permalink
Update ProjectController.php
Browse files Browse the repository at this point in the history
  • Loading branch information
OhmygoodR authored Jun 9, 2024
1 parent 5b954e6 commit 37ce55d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/Http/Controllers/ProjectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@

use App\Models\Project;
use Illuminate\Http\Request;
use Illuminate\Validation\Rules\File;

class ProjectController extends Controller
{
public function store(Request $request)
{
$request->validate([
// TASK: Write the validation rule so "logo" file would be MAX 1 megabyte
'logo'=>[File::image()->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([
Expand Down

0 comments on commit 37ce55d

Please sign in to comment.