Comments (6)
Do you have a use case where built-in stub is not good enough?
from laravel-widgets.
It's not hard to implement but I don't quite see the value of this customization.
from laravel-widgets.
Right now we can only use a run
method under the widget class, but in my use case, I would like to have two methods run
and setting
because I'm trying to create a system that offers the admin the possiblity to configure the widget from UI.
I know that this package is based only on the run
method and we can't call another one from outside, that's why I opted for this :
public function run()
{
if (isset($this->config['__setting'])) {
return $this->setting();
}else{
return $this->render();
}
}
protected function render() {
$config = $this->config;
// Do something and render
return view("user.view", compact('config'));
}
protected function setting() {
$config = $this->config;
// Do something to configure
return view("admin.view", compact('config'));
}
that's why I have to change stubs
from laravel-widgets.
Thanks, makes sense.
Gonna implement it in a couple of days.
from laravel-widgets.
Awesome thanks
from laravel-widgets.
Done in 3.3.
from laravel-widgets.
Related Issues (20)
- Passing variables to widget HOT 8
- reloadtimeout not working HOT 2
- Can i use laravel-widgets in jquery drag and drop HOT 1
- JavaScript callback on async widget HOT 4
- Accessing config array of widget externally HOT 1
- Cache forever HOT 3
- Compatible for laravel 8 HOT 1
- laravel widget async error HOT 3
- Composer killed on composer require arrilot-widgets HOT 1
- Unable to access Auth::id() in asyncWidget HOT 3
- Can not pass variable to Widget (via Config Array) HOT 5
- How do using ajax for pagination HOT 1
- Pricing of spaces HOT 1
- asyncWidget with chart data not showing anything HOT 3
- parseFullWidgetNameFromString breaks namespace with caps and lower case characters HOT 1
- Issue Wrap same group with a class (PS: not each) HOT 1
- PHP 8.2 deprecation error HOT 1
- Delay loading of asyncWidget? HOT 1
- Can we rearrange folder and file structure HOT 1
- jQuery is undefined
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-widgets.