Journey Blog - API
Cloning the Repository
- Beside the repository name, click and copy the clone URL (HTTPS).
- Open your terminal.
- Change the current working directory to the location where you want the cloned directory to be made.
- Type
git clone
, and then paste the URL you copied in Step 2. - Press Enter. Your local clone will be created.
Installing Dependencies
- Run the following commands on Git CMD or Other Command Shells (Run within the project's folder):
composer install
- To install required composer dependencies
- Access XAMPP or other cross-platform web servers (WAMP, MAMP, EasyPHP etc).
- Start your local server's Apache and MySQL services.
Getting Started
Environment
- Run
cp .env.example .env
on the command shell to copy the existing.env.example
file within the project folder. Fill in the fresh.env
copy with your own configurations. - Generate a new APP_KEY via
php artisan key:generate
artisan command.
Database
- Type
localhost/phpMyAdmin
on you address bar. - Create a new database with
phpMyAdmin
. I suggest that you usedb_journey
for your database name. - Open the command shell
- Run
php artisan passport:install
to install and setup the API auth related tables. - Next, type
php artisan migrate
and hit enter to activate the artisan command (Usephp artisan migrate --force
if the Laravel Passport install cause issues). - This will migrate the database tables and it will make the database accessible through
localhost/phpMyAdmin
.
Usage
- After migrating, execute a separate command shell within the project folder.
- Run
php artisan serve
on your command shell, just make sure you're within the directory of your local repository. - Open any modern browsers (Chrome, Firefox, Edge etc) and access the application by typing
http://localhost:8000
on your address bar. - To test the API without having to access the frontend, use the Insomnia REST Client and import this export file.