Giter VIP home page Giter VIP logo

laravel-multilingual-architecture's Introduction

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: [email protected]
    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:

laravel-multilingual-architecture's People

Stargazers

 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.