Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functional arrilot/laravel-widgets #47

Open
garbuzivan opened this issue Mar 8, 2020 · 4 comments
Open

Add functional arrilot/laravel-widgets #47

garbuzivan opened this issue Mar 8, 2020 · 4 comments

Comments

@garbuzivan
Copy link

garbuzivan commented Mar 8, 2020

I liked the arrilot/laravel-widgets functionality.
Roughly add widgets through the module:

class ModuleServiceProvider

use Illuminate\Support\Facades\View;

function boot()

$widgets  = app_path().'/Modules/'.$module.'/Widgets';

if ($this->files->isDirectory($widgets)){
	$directories = $this->files->directories($widgets);
	foreach($directories as $Widjet){ 
		$WidjetViews = $Widjet."/Views";
		if ($this->files->isDirectory($WidjetViews)) {
			View::addNamespace('Module.'.$module.'.Widget', $WidjetViews);
		}
		$controllerList = $this->files->files($Widjet);
		foreach($controllerList as $controller){
			include_once($controller->getPathname());
		}
	}
} 

laravel-project/
    app/
    └── Modules/
        └── FooBar/
            └── Widgets/
                └── Widget/
                     └── Views/
                          └── bar.blade.php
                     Bar.php

view('Module.FooBar.Widget::bar')

@Artem-Schander
Copy link
Collaborator

Hi @yanzlatov
I have no idea what the "arrilot/laravel-widgets" package is about and what the issue is here.
However, I'm about to release a v2. A lot of functionality (mainly generators) will be added.

@garbuzivan
Copy link
Author

Hi @yanzlatov
I have no idea what the "arrilot/laravel-widgets" package is about and what the issue is here.
However, I'm about to release a v2. A lot of functionality (mainly generators) will be added.

Package : https://github.com/arrilot/laravel-widgets/

No problems.
The implementation of the arrilot/laravel-widgets functions, the directory with the module (your package) is convenient for me.
For example, I’m doing a Blog module, it has a folder with widgets: the latest comments, the latest news, bookmarks, etc., which specifically relates to this module.

@Artem-Schander
Copy link
Collaborator

Ok, I see.
I will take al closer look at the widgets package and think about its general usability. For the time being I can not say if this will be implemented.
Anyways, thanks for your suggestion.

@garbuzivan
Copy link
Author

Ok, I see.
I will take al closer look at the widgets package and think about its general usability. For the time being I can not say if this will be implemented.
Anyways, thanks for your suggestion.

Ideally combine them in one package.
An example of the implementation of the interaction of two packages was thrown off by the code in the first message.

@Artem-Schander Artem-Schander added this to Manually test correct integration and functionality in different Laravel versions in v2 Mar 19, 2020
@Artem-Schander Artem-Schander removed this from Manually test correct integration and functionality in different Laravel versions in v2 Mar 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants