Turn Your Vehicle Into a Smart Earning Asset

While you’re not driving your car or bike, it can still be working for you. MOTOSHARE helps you earn passive income by connecting your vehicle with trusted renters in your city.

πŸš— You set the rental price
πŸ” Secure bookings with verified renters
πŸ“ Track your vehicle with GPS integration
πŸ’° Start earning within 48 hours

Join as a Partner Today

It’s simple, safe, and rewarding. Your vehicle. Your rules. Your earnings.

How to implement CRUD functions in the Laravel PHP Framework? Part-3

How to implement CRUD functions in the Laravel PHP Framework?

In previous blog Part-2, We have seen create() store() and index() functions.

Step 18. Go to app/Http/Controller/CustomerServiceController.php and in that we have to write code within edit() method and update(). Here edit() method will load edit form view file in browser and update() will update edit view file form data.

 public function edit($id)
    {
         $service = Service::where('service_id',$id)->first();
       return view('service.edit', compact('service'));
    }Code language: PHP (php)

Step 19. To Delete data first we have to make delete URL in resources/views/Service/index.blade.php.

Step 20. To Delete particular service data based on the value of id which has passed in delete link form. Write the following code within the destroy() method.

public function destroy($id)
    {
        $service = Service::where('service_id', $id);
        $service->delete();
        return redirect()->route('service.index')->with('success', 'Data Deleted');
    }Code language: PHP (php)

Now, we can add, edit and delete Customer Service Data

Thanks

Certification Courses

DevOpsSchool has introduced a series of professional certification courses designed to enhance your skills and expertise in cutting-edge technologies and methodologies. Whether you are aiming to excel in development, security, or operations, these certifications provide a comprehensive learning experience. Explore the following programs:

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.