Giter Club home page Giter Club logo

php-contact-form's Introduction

php-contact-form

Code Challenge.

Information

I decided to go ahead and use Laravel because it's what I'm most comfortable with. I also added a Vue.js component for the actual contact form simply because I kind of like Vue.

Setup

To get the repo setup, just download or fork the repo, and cd into the project folder. You'll then need to setup an .env file like mine here and change any variables that adhere to your local dev environment. I realize it's best not to have the .env file public, but there's nothing here worth stealing.

Once your .env file is set, you can run a few commands:

composer install
php artisan make:database
composer set-database
npm install
npm run production

Those should get the project ready to go. php artisan make:database is a custom command that should create a new MySQL database using the database name in your .env file. composer set-database is a custom composer command that runs a few commands in a row:

composer dump
php artisan migrate:fresh
php artisan migrate

I personally use valet for local development right now, but you can use whatever you'd like as long as you make sure the .env file is setup correctly (but you probably already knew that).

For testing, use phpunit or if you're like me you'll have to run vendor/bin/phpunit to run the tests.

Notes:

  • You will notice I swapped the order of the 2 processes, emailing [email protected] and saving a copy to the database, because I wanted to be able to send the model to the email to make it a bit easier.
  • Instead of phpunit I use vendor/bin/phpunit to use the project's vendor's phpunit.
  • I also have been using MailHog to handle sending emails locally in case there are some issues with local configurations, but there shouldn't be.

I've really enjoyed doing this code challenge!

php-contact-form's People

Contributors

a3mercury 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.