/web-builder

Laravel Website for build custom website

Primary LanguageBladeMIT LicenseMIT

WebBuilder

Welcome to the WebBuilder repository. This document provides a comprehensive guide to setting up and running the project locally.

Table of Contents

Prerequisites

Ensure you have the following software installed on your machine:

Installation

Follow these steps to set up the project locally:

  1. Clone the repository:

    git clone https://github.com/YuketsuSh/web-builder.git
    cd web-builder
  2. Install PHP dependencies:

    composer install
  3. Install Node.js dependencies:

    npm install

Configuration

  1. Environment Variables:

    Copy the .env.example file to .env:

    cp .env.example .env
  2. Generate Application Key:

    php artisan key:generate
  3. Set up your .env file:

    Configure your database and other environment settings in the .env file.

    DB_CONNECTION=mysql
    DB_HOST=127.0.0.1
    DB_PORT=3306
    DB_DATABASE=your_database
    DB_USERNAME=your_username
    DB_PASSWORD=your_password
    
    # Other configurations...

Database Setup

  1. Run Migrations:

    Make sure your database is created, then run the migrations:

    php artisan migrate
  2. Seed the Database (Optional):

    If you have seeders, run them to populate your database with initial data:

    php artisan db:seed

Running the Project

  1. Compile Assets:

    Compile your assets (CSS, JavaScript):

    npm run build
  2. Start the Development Server:

    Start the Laravel development server:

    php artisan serve

    The application will be accessible at http://localhost:8000.

Testing

Run the test suite to ensure everything is working correctly:

php artisan test

Contributing

Thank you for considering contributing to WebBuilder! Please read the contribution guidelines for details on our code of conduct and the process for submitting pull requests.

License

This project is open-sourced software licensed under the MIT license.

Additional Notes

Breeze Installation

This project uses Laravel Breeze for authentication scaffolding. Ensure you install and configure it as follows:

  1. Install Laravel Breeze:

    composer require laravel/breeze --dev
  2. Install Breeze's backend and frontend scaffolding:

    php artisan breeze:install
    npm install && npm run dev
  3. Run Migrations for Breeze:

    php artisan migrate

Spatie Roles and Permissions

This project uses Spatie's Laravel Permission package for role and permission management.

  1. Publish the configuration file:

    php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider"
  2. Run the Migrations:

    php artisan migrate
  3. Clear Cache:

    After setting up roles and permissions, clear the cache to reflect changes:

    php artisan cache:clear

Assign Admin Role

After setting up the project and creating a user account, you need to assign the admin role to a user. Follow these steps:

  1. Open Tinker:

    Laravel Tinker is a powerful REPL for the Laravel framework. Open Tinker by running:

    php artisan tinker
  2. Find the User:

    Find the user you want to assign the admin role to. Replace email@example.com with the user's email.

    $user = App\Models\User::where('email', 'email@example.com')->first();
  3. Assign the Admin Role:

    Assign the admin role to the user. Ensure the role exists in your roles table. If it does not exist, you will need to create it first.

    $user->assignRole('admin');
  4. Exit Tinker:

    Exit the Tinker console by typing exit.


Thank you for using my project ! If you have any questions or need further assistance, feel free to open an issue or contact me on discord or discord username (yuketsu).