Code Monkey home page Code Monkey logo

laravel-widgetize's Issues

how can i set key for extraCacheKeyDependency from params

Hi
How can i set key for extraCacheKeyDependency() function from params ?
extraCacheKeyDependency just get from query string
i use widget for related products and pass product id to widget like this :

@widget('Product\RelatedWidget', ['product_id' => $product_id])

since the extraCacheKeyDependency is execute first ,I cannot consider the product_id to send to the function

Environment variables return null

First of all: Thanks for this repository.

I had hard times to get the caching function to work.
Finally i figured out, it was a problem with my .env variables.
According to this.

I temporarily fixed this by putting the .env variables in a seperate config file.
For example the function widgetShouldUseCache in Imanghafoori\Widgets\Utils\Policies:
env('WIDGET_CACHE') returned here null.

/**
 * The caching is turned off when:
 * 1- we are running tests
 * 2- have disabled it in .env file.
 *
 * @return bool
 */
public function widgetShouldUseCache()
{
    return (config('widget.cache') !== false) && (! app()->environment('testing'));
    // return (env('WIDGET_CACHE', false) !== false) && (! app()->environment('testing'));
}

Maybe there is another problem on my side, otherwise i would suggest to implement publishing a seperate config file.

Laravel: 5.2.*
PHP: 7.0.4

cannot generate widget using artisan

PHP Fatal error: Call to undefined method Imanghafoori\Widgets\WidgetGenerator:
:qualifyClass() in E:\XAMPP\PHP56\htdocs\mb\vendor\imanghafoori\laravel-widgetiz
e\src\WidgetGenerator.php on line 131

[Symfony\Component\Debug\Exception\FatalErrorException]
Call to undefined method Imanghafoori\Widgets\WidgetGenerator::qualifyClass
()

E:\XAMPP\PHP56\htdocs\mb>php artisan make:widget MySexyWidget
PHP Fatal error: Call to undefined method Imanghafoori\Widgets\WidgetGenerator:
:qualifyClass() in E:\XAMPP\PHP56\htdocs\mb\vendor\imanghafoori\laravel-widgetiz
e\src\WidgetGenerator.php on line 131

component directive bug

Hello,

my test component :
image

my test view:
image

and result:
image
this exception throw when i use widgetize version 2.2
in version 1.9 there is no similar problem.

my test projects:
image

Technique of storing widgets configuration per instance?

My objective is to have my users be able to add widgets to their pages.
However some widgets may require user provided configuration, for example, a weather widget, the user will be required to input the desired city..
How/where would you store this instance specific information?
is that an existing functionality?

1.4.5 causes error

I installed this today and by following your insructions here on github, got a widget produced and working. However after a composer update, I received:

FatalErrorException in TopUsersWidget.php line 10:
Access level to App\Widgets\TopUsersWidget::$template must be public (as in class Imanghafoori\Widgets\BaseWidget)

Downgrading to 1.4.4 removed the error.
Changing the variable types to public removes this error but leads to another.

https://github.com/zigstum/laracasts-forum-widgets

Widget View File not found

Hi,
I have the following error:
"View file "Widgets::webSPV.Widgets.CategoriaAllieviWidgetView" not found by 'webSPV\Widgets\CategoriaAllieviWidget '

I'm using laravel 5.8 and I followed the install instruction.
They I typed: php artisan make:widget CategoriaAllieviWidget
and I have in my app/Widgets folder CategoriaAllieviWidget.php and CategoriaAllieviWidgetView.blade.php

I called @widget('CategoriaAllieviWidget', ['a' => 'someVal', 'b' => 'foo']) in a view and that's where the error rises.
do you have any clues?
thanks and good job for the great package

Seems to break Debugbar after composer require

Working locally on a new project and wanted to test this out. Unfortunately as soon as I install it with composer require it breaks https://github.com/barryvdh/laravel-debugbar/ - I don't even have to add the ServiceProvider.

Steps to reproduce:

  1. Using Laravel Valet (I am at least),
  2. Install new Laravel project (I'm using 5.4.26),
  3. composer require barryvdh/laravel-debugbar --dev,
  4. Add debugbar ServceProvider to config/app.php,
  5. Visit '/' to see debug bar,
  6. composer require imanghafoori1/laravel-widgetize,
  7. Visit '/' to see debug bar broken
  8. composer remove imanghafoori1/laravel-widgetize
  9. Visit '/' to see debug bar working again.

Error received from JS console:
Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://temp1.dev/_debugbar/assets/stylesheets?v=1496339168".

image

Call to undefined function Imanghafoori\Widgets\Utils\starts_with()

php v8.1
Version 1.8 is installed
I wanted to manually update to the latest version
I received these errors

composer update imanghafoori/laravel-widgetize
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

Problem 1
- imanghafoori/laravel-widgetize v2.2.46 requires php ^7.1.3|7.2.|7.3.|7.4.* -> your php version (8.1.10) does not satisfy that requirement.
- imanghafoori/laravel-widgetize v2.2.47 requires laravel/framework ~5.1|6.|7.|8.* -> found laravel/framework[v5.1.0, ..., v5.8.38, v6.0.0, ..., v6.20.44, v7.0.0, ..., v7.30.6, v8.0.0, ..., v8.83.27] but it conflicts with your root composer.json require (^10.10).
- imanghafoori/laravel-widgetize v2.2.48 requires laravel/framework ~5.1|6.|7.|8.|9. -> found laravel/framework[v5.1.0, ..., v5.8.38, v6.0.0, ..., v6.20.44, v7.0.0, ..., v7.30.6, v8.0.0, ..., v8.83.27, v9.0.0, ..., v9.52.16] but it conflicts with your root composer.json require (^10.10).
- Root composer.json requires imanghafoori/laravel-widgetize ^2.2 -> satisfiable by imanghafoori/laravel-widgetize[v2.2.46, v2.2.47, v2.2.48].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Internet explorer directives Issue

Hi
And thank you for this awsome package.
I have some issue preserving IE Directives like : <!--[if IE 9]><video style="display: none;"><![endif]-->
the widget output remove completely the content and write : <> instead.

on every HTML comment we have <> instead of the comment <!-- ... --> ,

HTML comment are not visible , but <> were rendred on the browser page !!

==========

  • Laravel version : 5.5
  • Laravel-widgetize : 1.8
  • PHP : 7.1.14
  • Apache : 2.4.27

==========

Thank you

Route Set To IP ,Not Domain

سلام آقای غفوری عزیز
من قبلا هم این مورد را عرض کرده بودم
وقتی توی ویجت از route استفاده میکنیم و موقعی که خود ویجت کش را می سازد به جای url اصلی از آی پی سرور استفاده می کند
این مشکل در قسمتهای مختلف وجود ندارد و تنها در ویجت ها پیش می آید
برای رفع این مشکل باید کامند کلیر کش را استفاده کنم تا دوباره آدرس روت ها درست ست شوند
php artisan cache:clear

مثلا تو ویجت منو :
<a href="{{ route('categorysearch',['category'=>'fragrances']) }}">Menuname</a>

تنظیمات اصلی همگی روی دامنه ست شده و حتی فورس هم شده ولی این مشکل اتفاق می افتد
web.php
URL::forceRootUrl('{domainname}');

.env:
APP_URL={domainname}

باید آدرس به صورت زیر شود
domainname/category/{categoryname}

ولی به صورت زیر میشود
186.32.36.52/category/{categoryname}

ممنون میشم راهنمایی کنید

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.