Git Product home page Git Product logo

laravel-modules's People

Contributors

billmn avatar bstrahija avatar deviarte avatar freezy-sk avatar ifnotfr avatar jbelcastro avatar karelv avatar noeldavies avatar piotrchludzinski avatar ptsilva avatar sloveniangooner avatar xgenvn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-modules's Issues

[Proposal] Add a module_asset() function

Hello,

Just a message to discuss about adding a module_asset() helper function.

While publishing module asset is working well, accessing is -i think- very very verbose and not productive.

Something like :

asset('packages/module/my_module/assets/css/style.css')

Could be changed to :

module_asset('my_module', 'css/style.css')

I think we do not have to know how the asset is published, just the asset is available for this module with a simple function.

What do you think about it ?

Tests

Does this support tests? If so, can I simply put them into a tests folder inside each module folder?

Prefix module name with the module routes.

I was wondering if there is any way to prefix the module name to the routes to maintain uniqueness.

Let say i have modules staff and users and both has the same route called users. In that case the one will override the other one. If we can prefix the module directory name before the route it will become unique by itself

staff/users
users/users

Get list of modules in a view composer

Hi.

I'm trying to get a list of the modules in a view composer, so I can generate a navigation menu of all modules.

In app/filters.php I put the following code

View::composer('nav', function($view)
{
    var_dump($app->modules->modules()->all());
});

but I got an Undefined variable: app error.
If i put the same code in app/views/layouts/master.blade.php, it works.

How can I get this data in a view composer?

Thanks!

Feature Request: publish assets in a folder named from origin

Hi,

i use following config:

    /**
     * The path that will contain our modules
     * This can also be an array with multiple paths
     */
    'path' => array(
        'modules',
        'portlets'
    ),

When i publish the assets from the module or portlets folder all will be published inside packages module...
It will bei nicer if the origin folder will be published in public:

Example:

I have a module in "modules/Sample1" . When i publish the assets it should be placed in "public/packages/modules/modules/Sample1" and...

the asstes of the module inside "portlets/Sample2" should be placed in "public/packages/modules/portlets/Sample2"

Bye, René

Load multiple modules

Hello,

Is it possible to use this package to load multiple modules at the same time?

What i want to achieve is a widget system where the whole app consists of modules.

Example:

This is meant to be a dashboard with different widgets and i want every widget to be a module.

Assci-art-example: http://paste.laravel.com/13jY

//Tim

Order of modules

Was wondering if there is any way of ordering modules. One module in my app is being processed before the other and I'd love to switch that around.

Any idea?

Infinite loop when using migrate:reset --pretend

Whenever I use php artisan migrate:reset --pretend I get a never ending output of Content: drop table wr_pages`` where wr_pages is just simple a Schema::drop ( 'pages' );

Furthermore, it would be awesome to see something like php artisan modules:migrate --reset which would not reset the migrations of my normal app.

Finally: thanks for making this package, it makes life quite a lot easier :)!

Complete app directory in modules

Can you put everything from the app directory like the database directory with migrations in a module?

Thanks for this module project good idea.

Seed with Artisan::call()

How to use seed with Artisan::call().

Somethink like this:

Artisan::call('modules:seed', array('--module' => 'service'));

Note: I know the normal way

Artisan::call('db:seed', array('--class' => 'App\\Modules\\Service\\Seeds\\DatabaseSeeder'));

Adding dependencies to modules

It would be nice if dependencies could be defined. Such as: the Messaging module needs the User module, perhaps even with a specific version like is being done with composer.json.

Are modules automatically registered ?

Hi,

I am using several modules and for each module a service provider class is defined as described in the documentation.

I have e.g. a module 'Category' and if i reference it inside a view I would like to use the provided Facade name 'Category' but that throws a 'class Category not found'. If i use 'App\Modules\Category\Models\Category' in the view then it works but that's a bit tedious.

If i however add 'App\Modules\Category\ServiceProvider' to the providers array in app/config/app.php then i can as expected just use the class 'Category' inside the view.

But does this mean i have to add the service provider classes for each module to the providers array to be able to use the Facade name? I was under the impression that the service providers for each module would be automatically registered at run time and it would suffice just to add Creolab\LaravelModules\ServiceProvider to the providers array, unless i am mistaking..?

Thanks for your reply.

laravel-modules breaks during artisan optimization

~/Documents/PhpStorm/AuthPilot(branch:master*) » php artisan
# Command works

~/Documents/PhpStorm/AuthPilot(branch:master*) » php artisan optimize
Generating optimized class loader

~/Documents/PhpStorm/AuthPilot(branch:master*) » php artisan
{
   "error":{
      "type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException",
      "message":"Class 'Creolab\\LaravelModules\\ServiceProvider' not found",
      "file":"\/Users\/devil\/Documents\/PhpStorm\/AuthPilot\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/ProviderRepository.php",
      "line":158
   }
}

Being able to use optimize would be extremely helpful as well.

permissions

Can you please change the permissions from 0755 to 0775 or at least make it a config option.

  • Side note - you may want to put in the docs that module:generate depends on way/generators... took me a bit to work this out :(

No hint path defined for [dashboard].

I'm just update to latest master-dev. Now, i got "No hint path defined for [xyz]" exception.
This exception throw from View::make('xyz::template'). Thanks

Seeds

Hi there,

I have been using modules extensively and was wondering if you are planning on a
modules:seed command?

best regards

Module Includes

Is there anyway to make the module includes /add/ to the array rather than overriding it from the default one?

Modules Manager Interface

I am suggesting to add interface for module management feature. I am wondering if you will database approach to register modules and enable/disable them via admin panel or you'll use the current structure.

BR

Bug

There's a major bug in this package it's to good lol. I see that you have came a long way since I made a suggestion about adding migrations in. Just wanted to say keep up the great work. Thanks.

Recursive module directory scan

Hi,

I'm wondering if you're planning on fleshing out the module scaning to recursively scan directories so there can be a bit more folder structure to the modules without having to register each path in the config.

I've tried playing about with it but I'm getting a 404 Exception somewhere between the 2nd and end of modules scanning. None of the routes are getting registered.

I was basically extracting the meat of the Finder->scan() into a loadModules() and then when you check for modules.json, if its false (ie not a module but a folder containing modules) just start diving into the directories.

May play around a bit more when I'm more awake and provide code samples.

[Proposal] Beautify module.json

What about beautify JSON content of module.json?
It can be more readable and fastest to modify.

My idea is to use JSON_PRETTY_PRINT in json_encode like:

$definition = json_encode(array('enabled' => true), JSON_PRETTY_PRINT);

Or better ... using PHP version check (because this constant is introduced in PHP 5.4) :

$definition = json_encode(array('enabled' => true), (version_compare(PHP_VERSION, '5.4.0', '>=') ? false : JSON_PRETTY_PRINT));

Thoughts?

The package only work with max 8 modules

Hello. I need help!
The package only can load max 8 modules. I do not can add more modules no will be charged.

Strangely not recognize nor the controllers nor methods.

Thank you!

Custom Files

I had to modify the package to accept a breadcrumbs.php so I can have two with separate templates for admin/public.

// Require module breadcrumbs.php
$breadcrumbs = $this->path('breadcrumbs.php');
if ($this->app['files']->exists($breadcrumbs)) require $breadcrumbs;

Which led me to wonder if custom files per module would be something for the json or some other solution? Maybe it is already possible and I missed it.

The package is https://github.com/davejamesmiller/laravel-breadcrumbs

Module views extends layout in app/views folder

What if i have the main layout view in app/views/layout/master.blade.php and in the apps/modules/blog/views/ folder i have a view index.blade,php and i want it to extend master.blade.php how would i write that.

I tried @extends('layout.master'), but did not work.

Thank you

Module ServiceProvider is not registered in manual mode

module service provider file

    $this->app->booting(function()
    {
        $loader = \Illuminate\Foundation\AliasLoader::getInstance();

        $loader->alias('MenuCategoryModel', 'App\Modules\Menu\Facades\MenuCategoryModelFacade');
    });

module.json file

   {
       "enabled" : true,
       "order"   : 1,
       "provider": "App\\Modules\\Menu\\ServiceProvider"
   }

when switching to auto mode, i can use the facade, but in the manual mode i get a class not found

No hint path defined for [core].

Hi first of all i really like your package. One thing what i encounterd.

Everything is autoloaded correctly.

I have the following folder structure

  • Core
    • controllers
    • models
    • views

routes.php
module.json

And when i load my view

$this->layout->content = View::make('core::users.index')

i get the following error
No hint path defined for [core].

Could you please give me a hint what i am doing wrong?

The directory "app/modules" does not exist.

A quick issue:

If you install the laravel-modules and include the service provider in the app.php and don't create the folder "app/modules", you get an error when trying to do anything with the artisan.

Perhaps it would be best if you could do a check on the directory existance.

Getting NotFoundHttpException on module routes

I have followed the instructions and no matter what I do, all I get is the NotFoundHttpException whoops page.

When I tried copy-pasting your example package into a new install, it worked - but as soon as I tried changing the name of the "content" module to something else (including changing all namespaces, references in routes, module.json files, etc. and performing composer and artisan dumps), I had the same issue.

Is there something I'm missing that is telling Laravel to use "content" as the default module or perhaps something else going on? (I'd be happy to send you my codebase if it would help).

Making use of generate:resource

Just a thought, since Way Generators has a generate resource command, would it be easier for when a modules gets created, the generate:resource command is called as well?

Calling a module model in another module model.

I installed the package. The problem is that, My ProductCatalog model can't see my CatalogProductImage model and hence it gives me the following error:

  Symfony \ Component \ Debug \ Exception \ FatalErrorException
  Class 'CatalogProductImage' not found

I don't know the reason. Here comes the code:

ProductCatalog.php

 <?php namespace App\Modules\Product\Models;

  use Illuminate\Auth\UserInterface;
  use Illuminate\Auth\Reminders\RemindableInterface;
  use Eloquent;
  use App\Modules\Product\Models\CatalogProductImage as CatalogProductImage;

 class ProductCatalog extends Eloquent {
      protected $table           = 'catalog';
      protected $primaryKey  = 'catalogId';
      protected $connection  = 'mysql2';
      public  $timestamps        =  FALSE; //update time stamp varsa true yap, updated_at ve created_at alanlarını otomatik gunceller

      public function category() {
          return $this->hasOne('CatalogCategory', 'catalogCategoryId', 'catalogCategoryId');
      }

      public function images() {
         return $this->hasMany('CatalogProductImage', 'catalogId');
     }
  }

CatalogProductImage.php

 <?php namespace App\Modules\Product\Models;

   use Illuminate\Auth\UserInterface;
  use Illuminate\Auth\Reminders\RemindableInterface;
  use Eloquent;

  class CatalogProductImage extends Eloquent {

 protected $table            = 'catalog_image';
     protected $primaryKey  = 'catalogImageId';
 protected $connection   = 'mysql2';
     public $timestamps      =  FALSE; //update time stamp varsa true yap, updated_at ve created_at alanlarını otomatik gunceller

      public function catalog() {
          return $this->hasMany('ProductCatalog', 'catalogId');
      }
  }

Migrate rollback or reset gives 'Class not found' error

I have a problem with the default php artisan migrate:rollback or php artisan migrate:reset. Probably same issue with refresh

I get the following when executing it.

PHP Fatal error:  Class 'CreateExampleTable' not found in .../vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php on line 29

Seems like a namespace issue. I tried adding a namespace in the top of the migration class file. But no luck.
Anyone having this issue?

Module outside application path

Hey, mate.

Me again.

So, I am doing a CMS which has multiple instances and I'd love to make my base module central, so in case of any changes it can only be changed in one place and it affects all instances.

The idea I was having was if it is possible to enlist a folder for modules outside of the application folder.

I have tried changing the base_path() to realpath() in the Finder.php (line 98) which actually finds the module outside but seems to break down the loading of the modules (guessing they are loaded with the relative path).

You have any idea how I could achieve that (to load them outside of application) and if you could add it to the package configuration).

Thanks for your reply.

Problem with modules:publish module

If the module don't exists return an error:
{"error":{"type":"Symfony\Component\Debug\Exception\FatalErrorException","message":"Call to a member function path() on a non-object","file":"D:
xampp\htdocs\Laravel\vendor\creolab\laravel-modules\src\Creolab\LaravelModules\ModulesPublishCommand.php","line":63}}

To fix: check if the module to publish if exists.

Just a small ideea

Why don;t you putt into the manual that is posible to create a module from composer?
I was using your examples and got only errors, and i started again, clean instalation, then the modules package and still errors. So i tried this on command line:
php artisan modules:create mymodule
And worked.
BTW great tool here.

[Proposal] multiple seeders per module

Hi.
This is a great package and I use it always ;).
I think it would be good if we could have multiple seeders per module.
If we set array for seeder in module.json for example

{
    "enabled": true,
    "seeder": [
        "Product\\Seeds\\ProductsSeeder",
        "Product\\Seeds\\AttributesSeeder"
    ]
}

There is little modification of Module.php:

    public function seed()
    {
        $classes = $this->def('seeder');

        foreach((array)$classes as $class){
           if (class_exists($class))
           {
               $seeder = new $class;
               $seeder->run();
           }
        }
    }

Thanks

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.