Ask Sawal

Discussion Forum
Notification Icon1
Write Answer Icon
Add Question Icon

How to Class 'App\Widgets\BaseDimmer' not found \vendor\tcg\voyager\resources\views\dimmers.blade.php) (PHP Scripting Language)

2 Answer(s) Available
Answer # 1 #
1
php
2
namespace App\Widgets;
3
use App\Models\News;
4
use Illuminate\Support\Facades\Auth;
5
use Illuminate\Support\Str;
6
use TCG\Voyager\Widgets\BaseDimmer;
7
class NewsDimmer extends BaseDimmer
8
{
9
    /**
10
     * The configuration array.
11
     *
12
     * @var array
13
     */
14
    protected $config = [];
15
    /**
16
     * Treat this method as a controller action.
17
     * Return view() or other content to display.
18
     */
19
    public function run()
20
    {
21
        $count =  News::count();
22
        $string = trans_choice('dimmer.news', $count);
23
        return view('voyager::dimmer', array_merge($this->config, [
24
            'icon'   => 'voyager-news',
25
            'title'  => {$count} {$string},
26
            'text'   => __('dimmer.news_text', ['count' => $count, 'string' => Str::lower($string)]),
27
            'button' => [
28
                'text' => __('dimmer.news_link_text'),
29
                'link' => route('voyager.news.index'),
30
            ],
31
            'image' => asset('images/paige_spiranac_golf.jpg'),
32
        ]));
33
    }
34
    /**
35
     * Determine if the widget should be displayed.
36
     *
37
     * @return bool
38
     */
39
    public function shouldBeDisplayed()
40
    {
41
        return Auth::user()->can('browse', app(News::class));
42
    }
43
}
[9]
Edit
Query
Report
Ghaziani Aaron
CONCRETE PIPE MAKER
Answer # 2 #

Widgets are mini-applications that run within the dashboard in Providence. Users can select and freely arrange widgets on their dashboard to create a custom system management interface.

The functionality that is encapsulated in a widget is only limited by space – they must fit within a single dashboard column (approximately 350 pixels wide). While widgets will typically provide simple, focused functionality, they have full access to the CollectiveAccess database and programming APIs, as well as their own configuration files and views. Widgets can interact with other CollectiveAccess plugins and external systems.

For more on the dashboard and widgets, and how to view the full list of widgets included in a standard installtion of CollectiveAccess, see Dashboard Configuration.

[2]
Edit
Query
Report
Sue Lipaz-Michael
Formal Science