nwidart / laravel-modules Goto Github PK
View Code? Open in Web Editor NEWModule Management In Laravel
Home Page: https://docs.laravelmodules.com
License: MIT License
Module Management In Laravel
Home Page: https://docs.laravelmodules.com
License: MIT License
I created Employee Module, but error message is still appearing like that
[Symfony\Component\Debug\Exception\FatalThrowableError]
Class 'Modules\Employee\Providers\EmployeeServiceProvider' not found
I don't exactly know this error message. Please help me. Thanks
hi how can i make a dynamic sidebar for modules so it gets module names and routes then make anchor tags in sidebar dynamic?
any idea how to do this ?
i thin i shoud use config files for each modules and save my data, then retrive it? but how get all module's config data
Hi,
I couldn't find a way to define default module to be loaded when entering my app.
In addition, is there any way to create hebrew routes for english-named modules?
Sorry for asking so many Question...
AdminMiddleware.php
Error:
ErrorException in Superadmin.php line 20:
Undefined variable: guard
namespace Modules\Superadmin\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
if (Auth::guard($guard)->guest()) {
I see in the main service provider the registerHtml
method. Am I wrong or It's never used? Laravel Collective dependency is there for a legacy requirement?
Hello,
when I want to generate new middleware class in command,
show error :
[Illuminate\Contracts\Filesystem\FileNotFoundException]
File does not exist at path F:\xampp\htdocs\new\black\storage\app/modules/modules.used
how to fix that?
Thank you
Hello sir,
I need a help from you. I am about to start a project in office since today. I started in L5.3 and used your modules extenstion from GitHub. The problem is, after using modules plugin, no any class is being supported in my Controllers.
Eg: Input Class not found.
I used to do projects in L 5.1 where I used pingping-sky and everything was working well. When I compared those two modules created by pingpong in 5.1 and laravel-modules in 5.3, I found that
In modules created by ping ping : there is this line
use Pingpong\Modules\Routing\Controller;
set by default in Newly created module, which is not present in the module created by laravel/modules. Do you think this is the issue?
Hoping positive solution from you ! It would be an big help if you could take some of your time to reply this message.
Thanks !!
The make:policy command exist in modules?
It would be great if there was a command to publish database seeders. I sometimes use them within migrations as a means to initially populate a table, and would thus love to be able to publish them to the main database/seeds directory.
I have installed your module and created a module and got some error.
https://gist.github.com/teddywest32/5d762735723619a67493c69cc8201b0f
I tried changing "module" folder to "Module" and php artisan started working but when i tried to create a controller it gave an error.
https://gist.github.com/teddywest32/8b268b57ef2b86bc03ba22e6d86e76ce
Could you confirm this is some issue or i am doing something wrong?
Hi,
I was trying to execute the following command
php artisan module:make-request LoginRequest
But, I got the following error.
File does not exist at path /laravel/storage/app/modules/modules.used
Hi,
I just migrate from ping-pon modules. Thanks for continue supporting this package!
I just noticed I don't need to add the module service provider to the application anymore. However I tried to deploy this but the application does not recognise de modules. I run php artisan module:list but there is no modules. I could add the service provider but I would like to know how it works in my local.
Thanks,
Since application is separated into modules, any http request should only access one module at a time.
Just imagine we have hundreds of modules, unrequested modules should not be booted or registered at all.
Should we provide a mechanism to archive this goal?
Is there a specific reason for using json in module definition?
Why not plain php config files? Having to write service provider and alias in js is rather a pain...
It really seems so...
From php artisan help module:make-controller
:
Generate new restful controller for the specified module.
Correct me if I'm wrong, but should'nt it generate a controller with full stack of methods (index, create, store, show, edit, update, destroy), like default Laravel generator does and not just one index() method?
Ofcourse, if it would generate all those methods, then additional views are required or some message could be displayed that views are not present. Moreover, generated get() route should be changed to a resource().
Anyway, I think it should either generate all methods (with option to generate plain one), or generator description should be changed.
If you for example run this code: php artisan module:make NewModule
. It generates all the files correctly except for the namespaces. It probably runs module name through an ucfirst() or something.
So after generating such module all three generated classes will be under namespace Modules\Newmodule. However, it should be under Modules\NewModule.
Hi,
Any plans to support 5.3 since its released?
Problem 1
- Installation request for nwidart/laravel-modules ^0.10.0 -> satisfiable by nwidart/laravel-modules[0.10].
- Conclusion: remove laravel/framework v5.3.0
thanks
After running command like this: php artisan module:make-controller Users UserModule
class named Users
will be created, but file will be named UsersController.php
. It should be consistent with appending Controller
to either both or none.
Is it any support for overriding default routes from the modules?
Say if I want to use subdomains instead of subfolder it would be easiest if subdomain.domain.com/something would override domain.com/something
At least kind of option to be set on the group / route to let it override the "default" routes
Hi. Is there a way to load modules in a specific order?
I'd like to say this is nice module.
It has an error that says afte creating Backend module.
Class 'CustomNameSpace\Backend\Providers\BackendServiceProvider' not found.
L v5.2.39
I tried to integrate this package to a Laravel 5.1 project but get,
"ReflectionException in Container.php line 741: Class web does not exist" error when accessing module urls. more info: http://pastebin.com/baJgfzdt
Please support for LTS versions. And any idea how to solve this?
Hi Nicolas,
We use AsgardCMS as custom configured. Could we use this package instead of pingpong/module (which is not provided from you).
Do you plan to implement this package to AsgardCMS?
Thanks.
Kernel file
protected $routeMiddleware = [
'superadmin' => \Modules\Superadmin\Middleware\Superadmin::class,
];
Module Route
Route::group(['middleware' => ['web', 'superadmin'], 'prefix' => 'superadmin', 'namespace' => 'Modules\Superadmin\Http\Controllers'], function()
{
Route::get('/', 'SuperadminController@index');
});
Hi, I have setup my base composer.json to have and created a module called "Auth":
"psr-4": { "App\\": "app/", "Modules\\": "Modules/" }
But when I try to render the view: "auth::login" it gives me the following error: "No hint path defined for [Auth]."
I understand that this is composer PSR-4 related error, however, I don't know how to fix it.
Do you have any ideas? I am running Laravel 5.3
Hi!
First I'd like to thank you for your great job in maintaining this module :)
I have a question/problem - is it possible to declare schedule task in module? Is there any good practice for that or should I just check in my main applications app/Console/Kernel.php file that the module is present and declare task there?
Hi There,
Is is already possible, or do you have plans to allow for policies and exceptions to be within the modules created by laravel-modules?
For policies, it looks like it is possible with the registerPolicies
function within the AuthServiceProvider
. So would each module require an instance of the AuthServiceProvider to register their policies? Or would it be easier to register each module's policies within the global AuthServiceProvider?
I assume that exception classes will be auto loaded by default, so it is just a case of creating a folder within each module and place the exceptions in there?
Thanks in advance for any advice offered.
How to register them? I went through readme, but couldn't find an example of how to do it.
Hi there, thank you for this package,
The problem is that when I execute
php artisan module:migrate-rollback
this error appear
[BadMethodCallException]
Method lists does not exist.
I search and found that laravel 5.3 replaced lists by pluck
Hi,
Can not install this package for LV v5.1 with this command:
omposer require nwidart/laravel-modules
Because composer.json
file requires v5.2 for laravel.
Can you please modify it so it works with LV5.1 too as it is still widely used version.
Thanks
It provides support for 5.3. Thank you.
Install the specified module by given module name.
Module::install('nwidart/hello');
What it will do?
Hello @nWidart it is nice to hear that you are contributing to a modular approach. ๐
I have a question that does this module works on Laravel 5.2 and will it be supporting the upcoming 5.3 version?
Thanks for the good work.
Hi,
In my system I've got products units table (part of Products module) where I keep pre-defined units: cm/mm/kg. Let's say I want to add extra unit to this table. My site is live (production) so I can't simply reinstall it to call a seeder once again with new values. I need to add new Seeder with just one line (new unit). It's not a cleanest way to do it. Is there any better way for that kind of actions?
hey there, thanks alot for this package it have been very useful to me ,i have been having a problem with trying to rollback a certain module in a certain database not the default one , it is working correctly with module:migrate by stating --database=connectionName
the Module::install()
function not working,
but the command line php artisan module:install
is working
how to fix this ?
Hello,
first of all I love laravel-modules and that you're taking care of this package. Would you consider the Laravel 5.3 support with the "routes" folder for all of the modules routes? The support for not adding unused folders by default would be really awesome as well.
Thanks
I created Employee Module, but error message is appearing on production server like that
[Symfony\Component\Debug\Exception\FatalThrowableError]
Class 'Modules\Employee\Providers\EmployeeServiceProvider' not found
Development -> Mac
Production -> Ubuntu server 14.04, Nginx
I also run a composer dump-autoload
and php artisan clear-compiled
on production.
Application is running stable on development server.
I don't exactly know this error message. Please help me. Thanks
Laravel 5.3 have the different directory structure. Can you please confirm whether this package is compatible to laravel 5.3 or not?
hi i have one module that is working fine on localhost which is windows, but my module got below error when i move it to linux hosting
FatalErrorException in Application.php line 598: Class 'Modules\SlideShow\Providers\SlideShowServiceProvider' not found
excuse me, I used your laravel-modules for laravel 5.3, but I 'm have difficulty,
I follow the steps install laravel-modules
when I type php artisan module:make Bulletin
is ok
and then type php artisan module:list
is not ok
because it show:
[Symfony\Component\Debug\Exception\FatalThrowableError] Class 'Modules\Bulletin\Providers\BulletinServiceProvider' not found
I checked the folder, this file exists.
Do I less steps !?
And other question can create route to Modules\Bulletin\route\api.php or web.php !?
And how do use restful api ?
thanks.
Hello, i have installed your package and organized laravel into modular structure.
I have created a module call User for example, how can i share to github ?
i want to know which folder of my module i need to GIT INIT?
can you show me some step?
thx
Create A Module.
Push the module to github.
Submit your module to the packagist website. Submit to packagist is very easy, just give your github repository, click submit and you done.
A custom Module does not accept additional Service Providers besides its own. Whenever I try to add a new one, it gives me a Not Found Error in the console even though I added this new provider to the providers array in module.json!
I need to create a module for my project that uses multiple composer packages which I don't want to add to my master Laravel project. So I need to publish config files for each one of these composer packages in my module and not in my master project and I don't know what to do to achieve this by the information you have provided in your package information.
Here is a my module config file using "willvincent/feeds" package :
'name' => 'Rss',
'scan' => [
'enabled' => true
],
'providers' => [
willvincent\Feeds\FeedsServiceProvider::class,
],
'aliases' => [
'Feeds' => willvincent\Feeds\Facades\FeedsFacade::class,
],
and what I wanted to do is running this command : php artisan vendor:publish --provider="willvincent\Feeds\FeedsServiceProvider"
but nothing happens. I think this is because of these two lines :
'providers' => [
willvincent\Feeds\FeedsServiceProvider::class,
],
'aliases' => [
'Feeds' => willvincent\Feeds\Facades\FeedsFacade::class,
],
I will be glad if you help me fix this problem.
Best Regards
Say I have a User module.
And say I also have a Blog module.
The Blog module has a Post model/entity.
I want to use the User entity from the User module in a posts()
relationship to the Post entity from the Blog module.
I.e. $user->posts()
In Ruby, this was possible by way of class_eval
, which allows you to re-open an existing class and add methods to it. E.g., in this case we could've re-opened the User entity (which is from a different module) from within the Blog module and added a public function posts()
method.
How can we do this in PHP and Laravel?
$ php artisan module:make-controller DashboardController
[Illuminate\Contracts\Filesystem\FileNotFoundException]
File does not exist at path C:\wamp\www\ppp\storage\app/modules/modules.used
Really like this package.
I would suggest you include commands for generating job classes within the module.
Such as
php artisan module:make-job SomeJob module
Also would love to have option for generating migrations for a model created.
For instance in L5 i could do
php artisan make:model TheModel -m
where the '-m' generates the migration for the model.
It would be nice to achieve that in the module
Thanks
Hey,
I've got event in my main application and handler/listener class in my new module - is there any way to bind those two classes in modules service provider? I tried adding
protected $listen = [ 'App\Events\MainAppEvent' => [ 'Modules\MyModule\Events\Handlers\EventHandler', ], ];
but it seems that it doesn't work :/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.