Giter Site home page Giter Site logo

catalyst's Introduction

User Upload Script in Laravel

This Laravel project includes a PHP script named user_upload.php designed to process a CSV file and insert its data into a MySQL database.

Installation and Setup

  1. Download:

    • Clone or download this repository.
  2. Dependencies:

    • Navigate to the project root directory and run composer update to install required dependencies.
  3. Database Setup:

    • Create a database named catalyst for the project.
  4. Configuration:

    • Configure the database details in the .env file.

Usage

Execute the following commands in the terminal or command prompt:

php user_upload.php user:upload          # Executes script functions to parse and insert data.

example :
php user_upload.php user:upload --file=users.csv --u root -p null -h 127.0.0.1

Script Command Line Directives

The script supports the following command line options (directives):

  • --file [csv file name]: Specifies the CSV file to be parsed.
  • --create_table: Builds the MySQL users table without further action.
  • --dry_run: Executes script functions but avoids altering the database.
  • -u: Specifies the MySQL username.
  • -p: Specifies the MySQL password.
  • -h: Specifies the MySQL host.
  • --help: Displays a list of available directives with details.

Furthermore, the user_upload.php script is located in app/Scripts/user_upload.php within this project.

catalyst's People

Contributors

mysaltern avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.