Skip to content
This repository has been archived by the owner on Sep 3, 2020. It is now read-only.

tgalfa/laravel-multilingual-architecture

Repository files navigation

Laravel Multilingual Architecture

A Multilingual Architecture with Laravel 5.6 PHP Framework. The Demo contains a simple multilingual blogging system with SEO meta-data generation.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

See:
https://laravel.com/docs/5.6/installation#server-requirements

Installing

Create your .env file from .env.example.
Set-up the database connections.

Generate the application's APP_KEY:

php artisan key:generate

And run migrations:

php artisan migrate

Run the database seeder in case you need dummy data.
Generated by Faker - https://github.com/fzaninotto/Faker.

php artisan db:seed

Run composer:

composer update

The Architecture

  • Following the general MVC pattern.
    The Models can be found in the app/Models/ folder.

Defined Service Providers:

  • App\Providers\PostServiceProvider
  • App\Providers\SeoServiceProvider

The Service Interfaces and their implementations can be found in the app/Services/ folder
The Controllers can be found in the app/Http/Controllers/ folder.
The Views can be found in the resources/views/ folder.

  • Routing
    The Public Web Routes are defined in the routes/web/web.php file.
    The Authorized Web Routes are defined in the routes/web/admin.php file.
    See available routes:
php artisan route:list
  • Localization
    The default locales are 'hu' and 'en'.
    To enable other locales change the supportedLocales key in the config file laravellocalization.php

  • Compiling Assets
    Webpack is used.

See:
https://laravel.com/docs/5.6/mix

For development (Run all Mix tasks)

npm run dev

For production (Run all Mix tasks and minify output)

npm run production
  • Admin Page
    To see the Admin Page use route: /login
    And the dummy user credentials (after db:seed):
    user: admin@test.com
    password: admin

Running the tests

Set-up a test database trough the env variable DB_TEST_DATABASE.
Run migration on the test database:

php artisan migrate --database=testing

Run unit tests with PHP Unit:

vendor/bin/phpunit

For writing unit tests see example: Tests\Unit\PostTest.php

Useful information:

Deployment

See: https://laravel.com/docs/5.6/deployment

You can also run the deploy script.
For more information see the file deploy.sh

./deploy.sh

Built With

Authors

  • Gergő Tar - Initial work - tgalfa

License

This project is licensed under the MIT License.

Acknowledgments

First of all thanks to the Laravel Team for building this awesome framework. https://github.com/laravel/laravel

Thanks:

Releases

No releases published

Packages

No packages published

Languages