php - Count rows with the same user id and printing it in Laravel-8

I was wondering how can I count rows with the same user Id and printing how many of them has been counter Here is my controller
public function files(Request $request)
{
$file = $request->file('uploadedfile');
$filename = $file->getClientOriginalName();
$filename = time(). '.' .$filename;
$path = Storage::disk('docs')
->putFileAs(
"/" . Auth::user()->id,
$file,
$filename
);
Fileupload::create([
'user_id' => Auth::user()->id,
'filename' => $path
]);
return redirect(route('dashboard.profile'));
}
So every time a new user registers a new folder appears for them with a generated, If that's the case how can I count every row with the same user Id in the fileupload folder then printing It in a number format.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: illuminate\http\exceptions\posttoolargeexception
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.