Skip to content

Create a CRUD application for clients following the specified instructions using Laravel 11.

Notifications You must be signed in to change notification settings

miusarname2/laravel-test-CRUD

Repository files navigation

Test project WMWISE

Project Documentation

Project Description: WMWISE Laravel Test

Project Overview: Create a CRUD application for clients following the specified instructions using Laravel 11.

Requirements:

  1. Fields for clients: name, address, phone, country (selectable from database).
  2. Country information should be fetched from the database.
  3. Client information should be stored in a database.
  4. Use Laravel Requests for request validation (optional).
  5. Send an email when a client is created using events and mailables (optional).

Development Stack:

  1. Backend: Laravel 11
  2. Frontend: Blade files, Alpine.js, Vue.js, or Inertia.js (choose according to comfort).
  3. Use English language for all code, including tables, columns, and codebase.

Steps:

  1. Set up Laravel environment.
  2. Create migrations for clients and countries tables with English names and columns.
  3. Implement CRUD operations for clients.
  4. Use Laravel Requests for request validation (optional).
  5. Implement email notification using events and mailables (optional).
  6. Create frontend views using Blade files with chosen frontend framework (Alpine.js, Vue.js, or Inertia.js).
  7. Test and validate functionality.
  8. Upload the project to GitHub.
  9. Grant access to GitHub repository to karenecv and kcardenas.
  10. Send the repository link to mtorres@wmwise.com and kcardenas@wmwise.com.

Expected Completion Time: The assigned task should be completed within 4 days after receiving this email.

Requirements

Before you begin, make sure you have the following installed:

  • PHP >= 7.4
  • Composer
  • Node.js and NPM -Git

Starting

  1. Clone the repository:

    git clone https://github.com/miusarname2/laravel-test-CRUD.git
  2. Install PHP and JavaScript dependencies:

    composer install
  3. Copy the .env.example file to .env and configure the environment variables.

  4. Generate the application key:

    php artisan key:generate
  5. Database Configuration:

    • If you wish to change the database configuration, update the .env file with your database credentials.

    • Connect to your database to manually add countries using the following SQL insertions as examples:

      INSERT INTO countries (created_at, name, updated_at)
      VALUES (NOW(), 'Argentina', NOW());
      INSERT INTO countries (created_at, name, updated_at)
      VALUES (NOW(), 'Brazil', NOW());
        INSERT INTO countries (created_at, name, updated_at)
        VALUES (NOW(), 'Canada', NOW());
        INSERT INTO countries (created_at, name, updated_at)
        VALUES (NOW(), 'China', NOW());
        INSERT INTO countries (created_at, name, updated_at)
        VALUES (NOW(), 'France', NOW());
         INSERT INTO countries (created_at, name, updated_at)
         VALUES (NOW(), 'Germany', NOW());
    • If you do not want to do inserts, the database environment variables are configured to connect to a cloud database service.

  6. Run the migrations:

    php artisan migrate
  7. Start the server:

    php artisan serve

You can now access your application at http://localhost:8000.

Use

To use the application, follow the following steps:

  • Access the URL http://localhost:8000.
  • The available routes are:
    • /clients: Shows a panel with all clients, with options to edit and delete.
    • /clients/create: Allows you to create a new client.
    • /clients/<client_id>/edit: Allows you to edit an existing client.

Example Client Panel

Data models

clients

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Client extends Model
{


    protected $fillable = ['name', 'address', 'phone', 'country_id'];

    public function country()
    {
        return $this->belongsTo(Countries::class);
    }

}

Countries

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Countries extends Model
{
    protected $fillable = ['name'];

    public function clients()
    {
        return $this->hasMany(Client::class);
    }
}

Native Documentation

Laravel Logo

Build Status Total Downloads Latest Stable Version License

About Laravel

Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:

Laravel is accessible, powerful, and provides tools required for large, robust applications.

Learning Laravel

Laravel has the most extensive and thorough documentation and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.

You may also try the Laravel Bootcamp, where you will be guided through building a modern Laravel application from scratch.

If you don't feel like reading, Laracasts can help. Laracasts contains over 2000 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.

Laravel Sponsors

We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel Patreon page.

Premium Partners

Contributing

Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the Laravel documentation.

Code of Conduct

In order to ensure that the Laravel community is welcoming to all, please review and abide by the Code of Conduct.

Security Vulnerabilities

If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via taylor@laravel.com. All security vulnerabilities will be promptly addressed.

License

The Laravel framework is open-sourced software licensed under the MIT license.

About

Create a CRUD application for clients following the specified instructions using Laravel 11.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published