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

First pass at upgrading to laravel 9 - lots to do, but the site works #204

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 0 additions & 53 deletions app/Exceptions/Handler.php

This file was deleted.

23 changes: 7 additions & 16 deletions app/Helpers/TwitterImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace App\Helpers;

use Illuminate\Support\Facades\Http;

class TwitterImage
{

Expand All @@ -21,22 +23,11 @@ public static function get(string $username) {

}

private static function getImageUrl(string $username) {

$url = sprintf('https://twitter.com/%s/profile_image?size=original', $username);

$client = new \GuzzleHttp\Client([
'allow_redirects' => true
]);

$client->get($url, [
'on_stats' => function (\GuzzleHttp\TransferStats $stats) use (&$url) {
$url = (string) $stats->getEffectiveUri();
},
]);

return $url;
// Doesn't actually work anymore - Twitter have updated their APIs - https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-users-show
// This would be a good PR :)

private static function getImageUrl(string $username) {
return sprintf('https://twitter.com/%s/profile_image?size=original', $username);
}

}
}
3 changes: 3 additions & 0 deletions app/Http/Middleware/EncryptCookies.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

class EncryptCookies extends Middleware
{

protected static $serialize = true;

/**
* The names of the cookies that should not be encrypted.
*
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Middleware/TrustProxies.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ class TrustProxies extends Middleware
protected $proxies;


protected $headers = Request::HEADER_X_FORWARDED_ALL;
protected $headers = Request::HEADER_FORWARDED;
}
4 changes: 2 additions & 2 deletions app/Models/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Post extends Model

/** @var array $fillable */
protected $fillable = ['title', 'body', 'slug', 'user_id', 'post_type', 'approved', 'approved_by'];

/** @var array $appends */
protected $appends = ['excerpt'];

Expand All @@ -25,7 +25,7 @@ class Post extends Model
*
* @return array
*/
public function sluggable()
public function sluggable() : array
{
return [
'slug' => [
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

$app->singleton(
Illuminate\Contracts\Debug\ExceptionHandler::class,
App\Exceptions\Handler::class
\Illuminate\Foundation\Exceptions\Handler::class
);

/*
Expand Down
28 changes: 15 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,24 @@
"license": "MIT",
"type": "project",
"require": {
"php": ">=7.0.0",
"cviebrock/eloquent-sluggable": "^4.3",
"cviebrock/eloquent-taggable": "^3.3",
"php": ">=8.0.0",
"cviebrock/eloquent-sluggable": "^9.0",
"cviebrock/eloquent-taggable": "^9.0",
"doctrine/dbal": "^2.7",
"fideloper/proxy": "~4.0",
"joepriest/passwordreset": "^1.2.1",
"laravel/framework": "5.6.*",
"laravel/passport": "^4.0",
"laravel/socialite": "^3.0",
"laravel/tinker": "~1.0",
"mashape/unirest-php": "^3.0",
"socialiteproviders/slack": "^3.0"
"fideloper/proxy": "^4.0",
"guzzlehttp/guzzle": "^7.0.1",
"laravel/framework": "^9.0",
"laravel/legacy-factories": "^1.3",
"laravel/ui": "^4.1",
"mashape/unirest-php": "^3.0"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.1",
"filp/whoops": "~2.0",
"fzaninotto/faker": "~1.4",
"laravel/sail": "^1.16",
"mockery/mockery": "~1.0",
"phpunit/phpunit": "~6.0",
"phpunit/phpunit": "^9.0",
"symfony/thanks": "^1.0"
},
"autoload": {
Expand Down Expand Up @@ -62,6 +61,9 @@
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
"optimize-autoloader": true,
"allow-plugins": {
"symfony/thanks": true
}
}
}
Loading