Closed WalkingInTheDarkness closed 5 years ago
thats the problem, dont change the route names, i also have a very similar setup where i nest the manager routes under the admin
url but without affecting the name. ex
Route::group(['middleware' => ['admin']], function () {
// ...
// "url: admin/"
Route::group(['prefix' => 'admin'], function () {
ctf0\MediaManager\MediaRoutes::routes();
// "name: admin."
Route::group(['as' => "admin."], function () {
// ...
});
});
});
updating the route names of the manager will cuz u nothing but a big headache
So, basically, URL can be changed in any way as long as the route names are kept untouched and everything will work smoothly?
exactly 👍
Thanks for quick reply, appreciate ;-)
I have done what advised: /routes/web.php:
/** Dashboard routes **/
Route::middleware([
'auth',
])->group(function() {
/** Routes available for authenticated users only **/
Route::group([
'prefix' => 'manage',
/** Do not change route names as that will break MediaManager **/
], function() {
Route::group([
'middleware' => 'role:superadministrator|administrator|editor|author',
], function() {
// MediaManager
ctf0\MediaManager\MediaRoutes::routes();
});
});
Route::group([
'prefix' => 'manage',
'as' => 'manage::',
], function() {
Route::group([
'middleware' => 'role:superadministrator|administrator|editor|author|user',
], function() {
(...)
but the problem I am facing now - image thumbnails are not displayed now:
quick check of image src
attribute and 'manage' bit is being added:
<img src="http://moeera-cms.test/storage/manage/pages/AI1ITePFhXEcmKCPEdOqDx9zMy0fZIFkXMG4Flyb.jpeg"
while the real path to image file is http://moeera-cms.test/storage/pages/AI1ITePFhXEcmKCPEdOqDx9zMy0fZIFkXMG4Flyb.jpeg
How can I fix this?
@ctf0 - could you please reopen it, it's not sorted out as you can see above.
have u updated the .env APP_URL = http://moeera-cms.test
? also what is the error in the console ?
try to long press the manager refresh btn and see if it fixes the issue for u.
yes, I have replaced APP_URL = localhost
, that was first thing I noticed after I installed Laravel-Media-Manager.
There are no errors in the console, just wrong string is provided to <img src
(__stack-files
, file preview) and to <a href
(__sidebar-info
, public URL) attributes. They came from file.path
and selectedFile.path
Vue props.
I have looked in Vue Developer Tool and baseUrl
is correct but it looks like paths are computed incorrectly:
can u show me a screenshot for the console error ?
also am not really sure where the manage
path come from, check your storage path and make sure you cleared the browser cache just to be on the safe side
manage
is a Route prefix
Console:
the route prefix shouldnt affect the storage path, can u make a repo with ur setup and send me a link to test ?
@ctf0 it had to be some cache issue, I have cleared everything, view, routes, config cache, browser cache and restarted nginx. Reinstalled Laravel-Media-Laravel and now it works, even with added URL prefix. Thanks for your help
L5.6
Usage
Route [media.files] not defined. (View: /Volumes/users/artur/WebDesign/ValetSites/moeera-cms/resources/views/vendor/MediaManager/_manager.blade.php
With
ctf0\MediaManager\MediaRoutes::routes();
as placed into/routes/web.php
by installation script (which results with: url like:media/action
and route names like:media.action
), everything (as far I checked) works. However if I decide to move this into some 'Route::group' to have access restricted for admins/authors (which results with: url like:manage/media/action
and route names like:manage::media.action
) going tomanage/media
results with error as aboveCan this be fixed by changing some configuration variable (but judging by names - not) or is the only way to change this (in
_manager.blade.php
):to this:
EDIT: There are several other places in the template where route() helper is used (like
<form action>
attributes).Changing route names provided to(EDIT 2 - no, it did not, only looked like this) Thanks!route()
helper sorted out the problem. Question remains - is this the only way to achieve this?