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-1

How to implement CRUD functions in the Laravel PHP Framework?

Within computer programming, the acronym CRUD stands for create, read, update and delete.

Step 1. Create a DataBase CustomerService.

Step 2. Right Click inside htdocs folder and open Git Bash.

Step 3. To create a Project,  we have to write following command.

composer create-project --prefer-dist laravel/laravel CustomerService "5.8.*"Code language: JavaScript (javascript)

Step 4. Open Folder CustomerService in sublime text.

Mysql Database connection Laravel

Step 5. Go to .env file to set the project path and give the project DB_DATABASE name and DB_USERNAME name.

Step 6. Go to config/database.php give the project DB_DATABASE name and DB_USERNAME name.

Step 7.  To create one model for creating table, write following command.

$ php artisan make:model Service -m

Step 8. To generate migration file for our Crud Operation in database/migrations folder.

 public function up()
    {
        Schema::create('services', function (Blueprint $table) {
            $table->bigIncrements('service_id');
            $table->string('service_name');
            $table->timestamps();
        });
    }Code language: PHP (php)

Step 9. After writing the above code in that migration file, migrate this table into the MySQL database, so we have to write the following command.

$ php artisan migrate

Step 10.  Laravel use PHP blade templating for display output on the web page. By using the blade template we can extend the master template from the child template.  Create master.blade.php file in Resource/views

Step 11. To create child file resources/views/Service folder with name create.blade.php. To extend the master template by using this @extends(‘master’)

Step 12.  To display this view file in the browser, so Create one controller and define the route of that controller then after we can display view file in the browser. To Create a Controller in App/Http/Controller folder so, write the following command.

$ php artisan make:controller ServiceController --resource

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.