Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if($request->hasfile('photo'))
- {
- $attachments = [];
- foreach($request->file('photo') as $key => $attachment){
- $data = $attachment->store($request->get('name'),'public');
- array_push($attachments,$data);
- }
- }
- if(count($attachments != null)){
- $implodedAttachment = implode(', ',$attachments);
- }
- $content->name = $request->input('name');
- $content->description = $request->input('description');
- $content->location = $request->input('location');
- $content->district = $request->input('district');
- $content->state = $request->input('state');
- $content->phone_no = $request->input('phone_no');
- $content->list = $request->input('list');
- $content->type = $request->input('type');
- $content->body = $request->input('body');
- $content->service_offered = implode(",",$request->input('service_offered',[]));
- $content->photo = $implodedAttachment;
- $content->update();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement