Giter VIP home page Giter VIP logo

Comments (2)

illuminate3 avatar illuminate3 commented on May 18, 2024

My structure is:
www /app/Modules/ModuleName/

I use in my Controller located at /app/Modules/ModuleName/Http/Controllers/UsersController

        return View('ModuleName::users.index');

In my views I just call:

@extends('app')

They are located at:
/app/Modules/ModuleName/Resources/Views/Users/index.blade

My default view is located in the normal laravel location:
/app/Resources/Views/app.blade
Which is nothing different than normal.

I hope this helps!

from modules.

TerrePorter avatar TerrePorter commented on May 18, 2024

Look in your app/Modules/ModuleName/Providers/ModuleNameServiceProvider.php

Should have a function called registerNamespaces, that is where the namespace is registered

protected function registerNamespaces()
    {
        Lang::addNamespace('AdminModule', __DIR__.'/../Resources/Lang/');

        View::addNamespace('AdminModule', __DIR__.'/../Resources/Views/');
    }

Then as @illuminate3 said you can access the views using the like :

return View('AdminModule::users.index');

Provided the file exists at the path referenced in the above function

from modules.

Related Issues (20)

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.