Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any chance to upgrade to Laravel 6? #139

Open
LucianoVandi opened this issue Oct 21, 2020 · 1 comment
Open

Any chance to upgrade to Laravel 6? #139

LucianoVandi opened this issue Oct 21, 2020 · 1 comment

Comments

@LucianoVandi
Copy link

Hello! I'm using Opus and really enjoy it. Anyway it's based on Laravel 5.4 that doesn't receive security fixes since Jan 2018. Even the closest LTS (5.5) has stopped receiving fixes on Aug 2020.

Upgrading to Laravel 6 will ensure support till Sept 2022.

The upgrade of the framework it self would be quite easy, there are only two packages that are a little bit critical: fenos/notifynder it's stopped at Laravel 5 and baum/baum where the latest is an alpha release (2.0.0-alpha1).

Thanks.

@gogo0618
Copy link

gogo0618 commented Jan 4, 2022

Upgraded project to Laravel 8 as follows:
1 use this updated composer file - composer.zip
2 fenos/notifynder - will be installed from local repository, just create new folder 'install' in the root of the project , download
Notifynder-4.3.0.zip and unpack it inside the install folder. Replace package composer file with this one - notifynder composer.zip
3 baum/baum - will be installed from local repository, just download etrepat-baum-1.1.1-0-g9290bed.zip and unpack it inside
the install folder. Replace package composer file with this one - baum composer.zip
4 App\Exceptions\Handler.php class - change Exception to Throwable ( exactly 3 places )
5 in config/session.php - correct this line - 'secure' => env('SESSION_SECURE_COOKIE', null),
6 run composer update
7 There will be some conflicting routes that need to be renamed inside web.php - or this file can be used instead web.zip
8 run composer update again
9 might be necessary to run - php artisan optimize:clear
10 some extra variable should be removed from WikiController.php - from method show remove 'pages', should look like this - compact('wiki', 'team', 'space', 'isUserLikeWiki', 'wikiTags', 'isUserWatchWiki', 'isWikiInReadList'));
11 - filterMembers() method from TeamController not working correctly - replace with this:
$query = $this->request->get('q');
$team = Auth::user()->getTeam();
$members = Team::find($team->id)->members()->where('slug', 'like', '%' . $query . '%')->get();
return $members;
12 Go to file 'vendor\baum\baums\src\Baum\Move.php' - find method 'fireMoveEvent' and change this line:
$method = $halt ? 'until' : 'dispatch';
13 CSRF is disabled , which is a very bad practice. To enable it go to app\Http\Kernel.php and uncomment
\App\Http\Middleware\VerifyCsrfToken::class,
If you do so then you'll have to search trough all Opus views files and find all '<form' fields ( on some pages there might be 2 forms) , and then add right after the <form field line - @csrf
In views\layouts\master.blade.php add just after the last meta tag - <meta name="_token" content="{{ csrf_token() }}">
In public/js/app.js add this code just after ( for example ) - this.params = params; :
$.ajaxSetup({ headers: {'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content')}} );
If CSRF verify is enabled then almost all delete methods won't work - either use form (with @csrf) or use ajax call to reach destroy routes

1 Upgraded project to Laravel8 + minor improvements - opus - laravel8 + minor improvements.zip
2 Upgraded project to Laravel8 + Locale/Translation + minor improvements - 2 opus - laravel8 + translation + minor improvements.zip
Advise you to use included mysql backup file ( just delete sample data) - user : [email protected] , password : 12345678 , team : IT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants