Giter VIP home page Giter VIP logo

modules's People

Contributors

akazorg avatar cbaconnier avatar chriskonnertz avatar dakiesse avatar denishacks avatar hamrahpay avatar jaesung2061 avatar kaidesu avatar litiano avatar marcoflorian avatar markdegrootnl avatar mgsmus avatar mohamedsharaf avatar nejtr0n avatar nguyentranchung avatar nickurt avatar nurmanhabib avatar pankitgami avatar petersooley avatar pipegris avatar poppabear8883 avatar rasim avatar syahzul avatar talbergs avatar thekanbo avatar torrentalle avatar ubazinga avatar underlinewords avatar veelasky avatar veneliniliev 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

modules's Issues

App namespace is hardcoded in stub files

The following error appears after installation from modules package:

"App\Modules\Users\Providers\UsersServiceProvider not found"

Reason (I think):

I've change the app name from "app" to "cms". So this produce an error. Please fix this! Thanks.

Sorry for my bad english, I'm from Germany ,)

the place of modules folder?

the app folder is the default for Laravel, so I think that the modules folder should be place out of app folder, it is good and easy to manage for my idea.
Example:

app/
      ..............
modules/
      ...........

json write issue with Facade method -- permission denied

Trying to fire the enable/disable facades but get permission errors.

module:disable Profiles

Works, but

Module::enable($module->name)

errors out.

Error:

file_put_contents(/Users/school/Sites/l5/app/Modules/Profiles//module.json): failed to open stream: Permission denied

I haven't tried changing and reverting permissions from my model/repository yet.

no module created

Mybe I miss some things, but when i create a module..nothing is created...even i have message that module was created.....when i list module...nothing is listed...

Module not loading

Hello,

i have created a module, enabled it, put a dd('Test') in the ServiceProvider and did a dump-autoload.

However, it does not seem to load the module. Also the routes are not accessible, so it is surely not loading the module.What am I doing wrong?

Thanks

Different Folder, modules not working

I created a modules with modules:make but I defined the path in the config as
I created the config file in config/caffeinated/modules.php. I looked around in the code and seemed config needed to be there.

This is my config file. The creation worked and the module is created as expected in the defined folder.

<?php
return [
    'path'      => './components/modules',
    'namespace' => 'App\Modules\\'
];

the module was created in the right path but when I do module:list it says not modules defined
Your application doesn't have any modules.
and the routes.php inside the folder is not being read. the route defined in the default routes.php in the newly created module is not working.

I thought may be the files are not being loaded so I added components/modules in the autoload in composer.json file but that is not also working.

Not loading module config

Hi,

Doesnt appear to load module config files?

Module
--Config
---config.php

\Config::get('module::config');

thanks

config:publish

Is there a command to publish the config files for this package (and themes) or do we just copy and paste them?

Arigatou!

Automatically set the default controler namespace for each module

A nice enhacement could be to automatically set the default controler namespace for each module.
Then you can call directly Module controller without specify the full namespace

namespace Test\Modules\Blog\Http\Controllers;

class BlogController extends \Test\Http\Controllers\Controller 
{
    public function index() {
        // You can call directly Module controller without specify the
        // full namespace \Test\Modules\Blog\Http\Controllers\BlogController@index
        return \URL::action('BlogController@index');
    }
}

Composer's packages

Hey,

You created very interesteing way to create L5 modules.The only thing that I don't like is the necessity of keepeing all that modules stuff within the main app structure.

Why can't modules be like regular composer's packages?

InvalidArgumentException on install

Laravel version: 5.0.1
html package added!

composer require caffeinated/modules

[InvalidArgumentException]
Could not find package caffeinated/modules at any version for your minimum-stability (stable). Check the package spelling or your minimum-stability

Error when composer update

Hello,

I installed caffeinated and realized that it gives "exception 'ErrorException' with message 'array_multisort(): Argument #3 is expected to be an array or a sort flag' in /Applications/MAMP/htdocs/myproject/vendor/caffeinated/modules/src/Caffeinated/Modules/Modules.php:264" error when i try to use composer update command.

Is it a bug?

Thanks.

Laravel function actioin()

First I created Module "System" then "Administration" and when in any view in any module call action(controllerName@method) I get namespace of first onyl Module System (App\Modules\System\Http\Contrllers)

Is there any way to change that or namspace or ti tis a bug

(dev-master 7ed243e) problems

on route:clear

error

PHP Warning:  Uncaught exception 'ErrorException' with message 'require(/Kagi/Http/routes.php): failed to open stream: No such file or directory' in /Users/...app/Modules/Kagi/Providers/RouteServiceProvider.php:41
Stack trace:

do you need more info?

[bug] when update, a 'PHP Fatal error' occurred.

PHP Fatal error: Can't use method return value in write context in /data/www/54mz.cn/web/vendor/caffeinated/modules/src/Caffeinated/Modules/Handlers/ModuleMakeHandler.php on line 171

if ( empty($this->finder->files($folder)) && empty($this->finder->files($folder)) ) {

Call to undefined method [package]

Hello

With the latest commit of Laravel 5 the following problem occurs:

BadMethodCallException in ServiceProvider.php line 111: Call to undefined method [package]

    in ServiceProvider.php line 111
    at ServiceProvider->__call('package', array('caffeinated/modules')) in ModulesServiceProvider.php line 24
    at ModulesServiceProvider->package('caffeinated/modules') in ModulesServiceProvider.php line 24
    at ModulesServiceProvider->register() in Application.php line 360
    at Application->register(object(ModulesServiceProvider)) in ProviderRepository.php line 83
    at ProviderRepository->load(array('App\Providers\AppServiceProvider', 'App\Providers\EventServiceProvider', 'App\Providers\RouteServiceProvider', 'Illuminate\Foundation\Providers\ArtisanServiceProvider', 'Illuminate\Auth\AuthServiceProvider', 'Illuminate\Cache\CacheServiceProvider', 'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider', 'Illuminate\Routing\ControllerServiceProvider', 'Illuminate\Cookie\CookieServiceProvider', 'Illuminate\Database\DatabaseServiceProvider', 'Illuminate\Encryption\EncryptionServiceProvider', 'Illuminate\Filesystem\FilesystemServiceProvider', 'Illuminate\Foundation\Providers\FoundationServiceProvider', 'Illuminate\Hashing\HashServiceProvider', 'Illuminate\Mail\MailServiceProvider', 'Illuminate\Pagination\PaginationServiceProvider', 'Illuminate\Queue\QueueServiceProvider', 'Illuminate\Redis\RedisServiceProvider', 'Illuminate\Auth\Passwords\PasswordResetServiceProvider', 'Illuminate\Session\SessionServiceProvider', 'Illuminate\Translation\TranslationServiceProvider', 'Illuminate\Validation\ValidationServiceProvider', 'Illuminate\View\ViewServiceProvider', 'Caffeinated\Modules\ModulesServiceProvider')) in Application.php line 336
    at Application->registerConfiguredProviders() in RegisterProviders.php line 15
    at RegisterProviders->bootstrap(object(Application)) in Application.php line 141
    at Application->bootstrapWith(array('Illuminate\Foundation\Bootstrap\DetectEnvironment', 'Illuminate\Foundation\Bootstrap\LoadConfiguration', 'Illuminate\Foundation\Bootstrap\ConfigureLogging', 'Illuminate\Foundation\Bootstrap\HandleExceptions', 'Illuminate\Foundation\Bootstrap\RegisterFacades', 'Illuminate\Foundation\Bootstrap\RegisterProviders', 'Illuminate\Foundation\Bootstrap\BootProviders')) in Kernel.php line 139
    at Kernel->bootstrap() in Kernel.php line 102
    at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 82
    at Kernel->handle(object(Request)) in index.php line 53

This is because there is no method package in \vendor\caffeinated\modules\src\Caffeinated\Modules\ModulesServiceProvider.php and there is also not such method in vendor\laravel\framework\src\Illuminate\Support\ServiceProvider.php

Migrations ignore module ordering

I'd like to launch migrations in proper order (using module.json order property), and i doesn't work. I suggest you should read all migartions from all modules first then you should sort them by name and launch in proper order (not module by module like you're doing now).

Class not found exception

I did a fresh installation for this and created a new module with

php artisan module:make blog like in example

<?php
namespace App\Http\Controllers\Blog;

use App\Http\Controllers\Controller;

class BlogController extends Controller{

function home() {

    return "hello";
}
}`

This is my blog controller inside the module

and this is my route file

Route::group(['prefix' => 'blog'], function() {
Route::get('/', function() {
    dd('This is the Blog module index page.');
});

    get('/home','Blog\BlogController@home');
});`

but when i hit blog/home i get this Blog\BlogController not found error

what am I missing?
am i supposed to include any folder for autoload?

possible? set route controller using a module controller

The title probably doesn't make sense so this is what I'm trying to do.

config/general.php

    'home_controller'                   => 'ModuleXYZController@index',

module/Http/routes.php

Route::get('/', Config::get('general.home_controller'));

Basically I'm trying to set up a way to have a module control what the "/" base route is.
However, laravel doesn't want to do this since it's looking for the controller automatically app/Http/Controllers directory.

For now, I just don't have "/" base route in app/Http/ directory.

codex-facades: correction

Module::getProperty('blog::description', 'This is a new description for the blog module.');

probably should be:

Module::setProperty('blog::description', 'This is a new description for the blog module.');

view not found exception

Hi,
when I keep the view file in original L5 views directory it works fine
but if I move the module specific views to module's view directory
and use
return view('messenger.index', compact('threads', 'currentUserId'));
it gives me error like:
View [messenger.index] not found.
Am I doing anything wrong here?

The Facade method Module::exists($slug) allways return false

The Facade method Module::exists($slug) allways return false
This happens because the method don't search by slug, the method check if module exists using directory basename.
This causes that I have to search modules converting first letter to uppercase

I create a module with slug blog

vagrant@homestead:~/www/laravel5$ php artisan module:make blog
Module [Blog] has been created successfully

When I execute this code:

echo 'shoud return true, returns '.(Module::exists('blog')? 'true': 'false')."\n";
echo 'shoud return false, returns '.(Module::exists('Blog')? 'true': 'false')."\n";

I don't get the expected results:

shoud return true, returns false
shoud return false, returns true 

Frontend and Backend strategy

Hi,
What do you suggest in order to have Frontend and Backend Modules? Should I have a common controller, route file, middleware, etc? Maybe separate in diferent modules like blog and blogAdmin?

Thanks

[enhancement] composer.json

Could you / Are you thinking of adding the ability to let modules have their own composer.json files?
Which would also mean some way to automatically add Service Providers and Aliases to config/app.php or have the module be able to autoload them.

example module?

Hi Kai,
I'm wondering if you have an example module?

Domo!

default RouteServiceProvider overrides the root controller namespace

The default RouteServiceProvider generated overrides the root controller namespace of Illuminate\Contracts\Routing\UrlGenerator

Then when Url Generator is invoked,

URL::action('WelcomeController@index');

Exception occurs

FatalErrorException in UrlGenerator.php line 440: Call to a member function domain() on null

    1. in UrlGenerator.php line 440
    2. at HandleExceptions->fatalExceptionFromError(array('type' => '1', 'message' => 'Call to a member function domain() on null', 'file' => '/home/vagrant/www/laravel5/vendor/laravel/framework/src/Illuminate/Routing/UrlGenerator.php', 'line' => '440')) in HandleExceptions.php line 116
    3. at HandleExceptions->handleShutdown()

because UrlGenerator is looking for \App\Modules\Blog\Http\Controllers\WelcomeController@index

Class 'Caffeinated\Modules\ModulesServiceProvider' not found

After fresh install of Laravel 5 and adding Caffeinated provider and alias to app.php, I have added another package to composer.json and after running composer update there was an error:

vagrant@homestead:~/code/fs$ composer dump-autoload
Generating autoload files
vagrant@homestead:~/code/fs$ php artisan route:list
PHP Fatal error:  Class 'Caffeinated\Modules\ModulesServiceProvider' not found in /home/vagrant/code/fs/storage/framework/compiled.php on line 5019
PHP Stack trace:
PHP   1. {main}() /home/vagrant/code/fs/artisan:0
PHP   2. require_once() /home/vagrant/code/fs/artisan:30
PHP   3. require() /home/vagrant/code/fs/bootstrap/start.php:56
PHP   4. Illuminate\Foundation\ProviderRepository->load() /home/vagrant/code/fs/vendor/laravel/framework/src/Illuminate/Foundation/start.php:195
PHP   5. Illuminate\Foundation\ProviderRepository->createProvider() /home/vagrant/code/fs/storage/framework/compiled.php:4988
{"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Class 'Caffeinated\\Modules\\ModulesServiceProvider' not found","file":"\/home\/vagrant\/code\/fs\/storage\/framework\/compiled.php","line":5019}}

I have fixed id by adding below code to autoload section in composer.json

"psr-0": {
    "Caffeinated\\": "vendor/caffeinated/modules/src/"
}

Also another bug was in RouteServiceProvider.php in generated module.
Now there should be:

use Illuminate\Routing\RoutingServiceProvider as ServiceProvider;

instead of:

use Illuminate\Routing\RouteServiceProvider as ServiceProvider;

Modules only as needed

Hi Kai,

I have been worried about Laravel workbenches since Taylor removed them from Laravel 5.0. I was using workbenches for something they were never really intended to be used as; modules. Basically my CMS allows users to create "apps" on the fly, these apps are actually workbenches. Now users can code "apps" in true Laravel, which was the entire point because we all love Laravel. My CMS has a custom URL parser with a Mysql router table, if the route has a "app" tied to it, only then do I actually Add the apps workbench service provide, mod the views path...actually fire up the "app". This allows me to have thousand of workbenches (apps) that are ONLY registered when needed based on the url...very efficient.

Your new modules project looks like a perfect replacement to exactly what I need and I was wondering how it works with thousands of modules. Are all 1000 registered always, or only as needed and can I take control of when they are registered (via URL analysis) instead of your module.json file ??

[question] extend a module through another module

I was wondering but having a feeling that you can't but anyways,

Is there any to extend a module based on another module?

For example, adding relationships: You start of with a typical user model but then decide to split out the blog functionality into it's own module. But you are left with the issue of adding the relationship back to the blog within the user module.

How To Call View in Controller

Hi, I just start using this package and its cool. What I didnt figure out is how to call View in Controller I have folder structure App\Components\System on example and how to call view in controller and is it possible to view layout in Module extend a main laravel view layout master on example and how to do it I dont have any ideas more.

Module order

Hi,
Is there a way to set the loading order of the modules? Maybe a order option in the module.json file?
Something like this would work:

Modules.php:

public function getByEnabled($enabled = true)
    {
        $data    = [];
        $modules = $this->all();
        $order = [];

        if (count($modules)) {
            foreach ($modules as $module) {
                if ($enabled === true) {
                    if ($this->isEnabled($module['slug']))
                        $data[] = $module;
                        $order[] = $module['order'];
                } else {
                    if ($this->isDisabled($module['slug']))
                        $data[] = $module;
                }
            }
        }

        array_multisort($order, SORT_ASC, $data);

        return $data;
    }

module.json:

{
    "name": "Pages",
    "slug": "pages",
    "version": "1.0",
    "description": "This is the description for the Pages module.",
    "enabled": true,
    "order": 0
}

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.