forked from php-flasher/flasher-laravel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.php
193 lines (183 loc) · 8.78 KB
/
config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<?php
/*
* This file is part of the PHPFlasher package.
* (c) Younes KHOUBZA <[email protected]>
*/
return array(
/*
|---------------------------------------------------------------------------
| Default PHPFlasher library
|---------------------------------------------------------------------------
| This option controls the default library that will be used by PHPFlasher
| to display notifications in your Laravel application. PHPFlasher supports
| several libraries, including "flasher", "toastr", "noty", "notyf",
| "sweetalert" and "pnotify".
|
| The "flasher" library is used by default. If you want to use a different
| library, you will need to install it using composer. For example, to use
| the "toastr" library, run the following command:
| composer require php-flasher/flasher-toastr-laravel
|
| Here is a list of the supported libraries and the corresponding composer
| commands to install them:
|
| "toastr" : composer require php-flasher/flasher-toastr-laravel
| "noty" : composer require php-flasher/flasher-noty-laravel
| "notyf" : composer require php-flasher/flasher-notyf-laravel
| "sweetalert" : composer require php-flasher/flasher-sweetalert-laravel
| "pnotify" : composer require php-flasher/flasher-pnotify-laravel
*/
'default' => 'flasher',
/*
|---------------------------------------------------------------------------
| Main PHPFlasher javascript file
|---------------------------------------------------------------------------
| This option specifies the location of the main javascript file that is
| required by PHPFlasher to display notifications in your Laravel application.
|
| By default, PHPFlasher uses a CDN to serve the latest version of the library.
| However, you can also choose to download the library locally or install it
| using npm.
|
| To use the local version of the library, run the following command:
| php artisan flasher:install
|
| This will copy the necessary assets to your application's public folder.
| You can then specify the local path to the javascript file in the 'local'
| field of this option.
*/
'root_script' => array(
'cdn' => 'https://cdn.jsdelivr.net/npm/@flasher/[email protected]/dist/flasher.min.js',
'local' => '/vendor/flasher/flasher.min.js',
),
/*
|---------------------------------------------------------------------------
| PHPFlasher Stylesheet
|---------------------------------------------------------------------------
| This option specifies the location of the stylesheet file that is
| required by PHPFlasher to style the notifications in your Laravel application.
|
| By default, PHPFlasher uses a CDN to serve the latest version of the stylesheet.
| However, you can also choose to download the stylesheet locally or include it
| from your assets.
|
| To use the local version of the stylesheet, make sure you have the necessary
| assets in your application's public folder. Then specify the local path to
| the stylesheet file in the 'local' field of this option.
*/
'styles' => array(
'cdn' => 'https://cdn.jsdelivr.net/npm/@flasher/[email protected]/dist/flasher.min.css',
'local' => '/vendor/flasher/flasher.min.css',
),
/*
|---------------------------------------------------------------------------
| Whether to use CDN for PHPFlasher assets or not
|---------------------------------------------------------------------------
| This option controls whether PHPFlasher should use CDN links or local assets
| for its javascript and CSS files. By default, PHPFlasher uses CDN links
| to serve the latest version of the library. However, you can also choose
| to use local assets by setting this option to 'false'.
|
| If you decide to use local assets, don't forget to publish the necessary
| files to your application's public folder by running the following command:
| php artisan flasher:install
|
| This will copy the necessary assets to your application's public folder.
*/
'use_cdn' => true,
/*
|---------------------------------------------------------------------------
| Translate PHPFlasher messages
|---------------------------------------------------------------------------
| This option controls whether PHPFlasher should pass its messages to the Laravel's
| translation service for localization.
|
| By default, this option is set to 'true', which means that PHPFlasher will
| attempt to translate its messages using the translation service.
|
| If you don't want PHPFlasher to use the Laravel's translation service, you can
| set this option to 'false'. In this case, PHPFlasher will use the messages
| as-is, without attempting to translate them.
*/
'auto_translate' => true,
/*
|---------------------------------------------------------------------------
| Inject PHPFlasher in Response
|---------------------------------------------------------------------------
| This option controls whether PHPFlasher should automatically inject its
| javascript and CSS files into the HTML response of your Laravel application.
|
| By default, this option is set to 'true', which means that PHPFlasher will
| listen to the response of your application and automatically insert its
| scripts and stylesheets into the HTML before the closing `</body>` tag.
|
| If you don't want PHPFlasher to automatically inject its scripts and stylesheets
| into the response, you can set this option to 'false'. In this case, you will
| need to manually include the necessary files in your application's layout.
*/
'auto_render' => true,
'flash_bag' => array(
/*
|-----------------------------------------------------------------------
| Enable flash bag
|-----------------------------------------------------------------------
| This option controls whether PHPFlasher should automatically convert
| Laravel's flash messages to PHPFlasher notifications. This feature is
| useful when you want to migrate from a legacy system or another
| library that uses similar conventions for flash messages.
|
| When this option is set to 'true', PHPFlasher will check for flash
| messages in the session and convert them to notifications using the
| mapping specified in the 'mapping' option. When this option is set
| to 'false', PHPFlasher will ignore flash messages in the session.
*/
'enabled' => true,
/*
|-----------------------------------------------------------------------
| Flash bag type mapping
|-----------------------------------------------------------------------
| This option allows you to map or convert session keys to PHPFlasher
| notification types. On the left side are the PHPFlasher types.
| On the right side are the Laravel session keys that you want to
| convert to PHPFlasher types.
|
| For example, if you want to convert Laravel's 'danger' flash
| messages to PHPFlasher's 'error' notifications, you can add
| the following entry to the mapping:
| 'error' => ['danger'],
*/
'mapping' => array(
'success' => array('success'),
'error' => array('error', 'danger'),
'warning' => array('warning', 'alarm'),
'info' => array('info', 'notice', 'alert'),
),
),
/*
|---------------------------------------------------------------------------
| Global Filter Criteria
|---------------------------------------------------------------------------
| This option allows you to filter the notifications that are displayed
| in your Laravel application. By default, all notifications are displayed,
| but you can use this option to limit the number of notifications or
| filter them by type.
|
| For example, to limit the number of notifications to 5, you can set
| the 'limit' field to 5:
| 'limit' => 5,
|
| To filter the notifications by type, you can specify an array of
| types that you want to display. For example, to only display
| error notifications, you can set the 'types' field to ['error']:
| 'types' => ['error'],
|
| You can also combine multiple criteria by specifying multiple fields.
| For example, to display up to 5 error notifications, you can set
| the 'limit' and 'types' fields like this:
| 'limit' => 5,
| 'types' => ['error'],
*/
'filter_criteria' => array(
'limit' => 5, // Limit the number of notifications to display
),
);