Giter VIP home page Giter VIP logo

laravelmarket's Introduction

LaravelMarket

Start Laravel Market

Install

$ git clone https://github.com/puuble/laravelMarket.git
$ cd laravelMarket
$ composer install
$ npm install

step 1 (optional)

https://laravel.com/docs/5.3/redis click this link after follow step by step. We required predis ! This step (laravel redis configuration) is optional. if you are choice please config your .env file.

step 2

Modules and Branch

check this link for more informations. https://www.atlassian.com/git/tutorials/using-branches/

$ git branch <module_name>
$ git checkout <module_name>
$ git push -u origin <module_name>

And sent pull request check this link https://help.github.com/articles/creating-a-pull-request/

Working With Modules on Laravel Market

$ git branch TestModule
$ git checkout TestModule

Now ready to working for modules. We change branch on TestModule.

php artisan module:create <module_name>

This code custom command (module:create) in Laravel Market from app/Console/Commands This code mean is created new module in LM for example

php artisan module:create TestModule

Please Choice Module Root  ? [Frontend]:
  [0] Frontend
  [1] Admin
  [2] User

Explain: Looking the app/Modules/ folder. You will see 3 main folders in this folder. The code in the example inserts the Module in these folders. 0 - Frontend 1 Admin 2 User. Why did we do that ? Because Admin and User modules have own middleware and permissions. If you develop Module for User side Choice 2. Frontend is default choice and no guest mode no middleware and no auth etc.

Results: I choice 0 - Frontend and created successfuly changes. Look at app/modules/TestModule folder and subfolders. You will see Controllers Models Views sub folders in the TestModule.

Go to Controllers folder check ActionController.

namespace App\Modules\Frontend\TestModule\Controllers;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
  public function index()
    {
        //
        return 'Hello Laravel Market';
    }

step 3 Access Modules on Browsers

Now! We required config/Module.php.

TestModule write in the frontend area.

   'Admin' => [], //admin side module lists

    'Frontend' => [
        'TestModule'
    ], // frontend side module lists


    'User' => [], // user side module lists

And .. Check Your Browser Example:

http://lm.dev/testModule

Step 4 Views

Check TestModule/Controllers/ActionController

  public function index()
    {
        //
        return 'Hello Laravel Market';
    }

Change

  public function index()
    {
        //
        return view('TestModule::index');
    }

And create index.blade.php in the testModule/Views folder

  Hello Laravel Market from the Turkey

Browser time

http://lm.dev/testModule

Working Models

Create

$ php artisan make:model Modules/Frontend/TestModule/Models/TestModel

Check

<?php

namespace App\Modules\Frontend\TestModule\Models;

use Illuminate\Database\Eloquent\Model;

class TestModel extends Model
{
    //
}

Use

use App\Modules\Frontend\TestModule\Models\TestModel;
public function index()
    {
        //
        TestModel::class;
        return view('TestModule::index');
    }

#Final Step

git push -u origin TestModule 

And get pull request

laravelmarket's People

Contributors

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