Bump laravel, v9 => v10

This commit is contained in:
Daniel Supernault 2023-04-19 22:30:37 -06:00
parent 66c0b3577f
commit b1f95a7213
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
19 changed files with 162 additions and 176 deletions

View file

@ -11,7 +11,10 @@ class AccountInterstitial extends Model
* *
* @var array * @var array
*/ */
protected $dates = ['read_at', 'appeal_requested_at']; protected $casts = [
'read_at' => 'datetime',
'appeal_requested_at' => 'datetime'
];
public const JSON_MESSAGE = 'Please use web browser to proceed.'; public const JSON_MESSAGE = 'Please use web browser to proceed.';

View file

@ -6,7 +6,10 @@ use Illuminate\Database\Eloquent\Model;
class Activity extends Model class Activity extends Model
{ {
protected $dates = ['processed_at']; protected $casts = [
'processed_at' => 'datetime'
];
protected $fillable = ['data', 'to_id', 'from_id', 'object_type']; protected $fillable = ['data', 'to_id', 'from_id', 'object_type'];
public function toProfile() public function toProfile()

View file

@ -14,10 +14,10 @@ class Avatar extends Model
* *
* @var array * @var array
*/ */
protected $dates = [ protected $casts = [
'deleted_at', 'deleted_at' => 'datetime',
'last_fetched_at', 'last_fetched_at' => 'datetime',
'last_processed_at' 'last_processed_at' => 'datetime'
]; ];
protected $guarded = []; protected $guarded = [];

View file

@ -46,7 +46,7 @@ class VideoThumbnail extends Command
->take($limit) ->take($limit)
->get(); ->get();
foreach($videos as $video) { foreach($videos as $video) {
Pipeline::dispatchNow($video); Pipeline::dispatchSync($video);
} }
} }
} }

View file

@ -46,7 +46,7 @@ class ContactController extends Controller
$contact->response = ''; $contact->response = '';
$contact->save(); $contact->save();
ContactPipeline::dispatchNow($contact); ContactPipeline::dispatchSync($contact);
return redirect()->back()->with('status', 'Success - Your message has been sent to admins.'); return redirect()->back()->with('status', 'Success - Your message has been sent to admins.');
} }

View file

@ -80,7 +80,7 @@ class DeleteAccountPipeline implements ShouldQueue
$id = $user->profile_id; $id = $user->profile_id;
Status::whereProfileId($id)->chunk(50, function($statuses) { Status::whereProfileId($id)->chunk(50, function($statuses) {
foreach($statuses as $status) { foreach($statuses as $status) {
StatusDelete::dispatchNow($status); StatusDelete::dispatchSync($status);
} }
}); });

View file

@ -95,7 +95,7 @@ class StatusDelete implements ShouldQueue
Media::whereStatusId($status->id) Media::whereStatusId($status->id)
->get() ->get()
->each(function($media) { ->each(function($media) {
MediaDeletePipeline::dispatchNow($media); MediaDeletePipeline::dispatchSync($media);
}); });
if($status->in_reply_to_id) { if($status->in_reply_to_id) {

View file

@ -16,7 +16,10 @@ class Like extends Model
* *
* @var array * @var array
*/ */
protected $dates = ['deleted_at']; protected $casts = [
'deleted_at' => 'datetime'
];
protected $fillable = ['profile_id', 'status_id', 'status_profile_id']; protected $fillable = ['profile_id', 'status_id', 'status_profile_id'];
public function actor() public function actor()

View file

@ -17,12 +17,11 @@ class Media extends Model
* *
* @var array * @var array
*/ */
protected $dates = ['deleted_at'];
protected $guarded = []; protected $guarded = [];
protected $casts = [ protected $casts = [
'srcset' => 'array' 'srcset' => 'array',
'deleted_at' => 'datetime'
]; ];
public function status() public function status()

View file

@ -14,7 +14,9 @@ class Mention extends Model
* *
* @var array * @var array
*/ */
protected $dates = ['deleted_at']; protected $casts = [
'deleted_at' => 'datetime'
];
protected $guarded = []; protected $guarded = [];

View file

@ -9,7 +9,9 @@ class Newsroom extends Model
protected $table = 'newsroom'; protected $table = 'newsroom';
protected $fillable = ['title']; protected $fillable = ['title'];
protected $dates = ['published_at']; protected $casts = [
'published_at' => 'datetime'
];
public function permalink() public function permalink()
{ {

View file

@ -14,7 +14,9 @@ class Notification extends Model
* *
* @var array * @var array
*/ */
protected $dates = ['deleted_at']; protected $casts = [
'deleted_at' => 'datetime'
];
protected $guarded = []; protected $guarded = [];

View file

@ -19,10 +19,10 @@ class Profile extends Model
*/ */
public $incrementing = false; public $incrementing = false;
protected $dates = [ protected $casts = [
'deleted_at', 'deleted_at' => 'datetime',
'last_fetched_at', 'last_fetched_at' => 'datetime',
'last_status_at' 'last_status_at' => 'datetime'
]; ];
protected $hidden = ['private_key']; protected $hidden = ['private_key'];
protected $visible = ['id', 'user_id', 'username', 'name']; protected $visible = ['id', 'user_id', 'username', 'name'];

View file

@ -6,7 +6,9 @@ use Illuminate\Database\Eloquent\Model;
class Report extends Model class Report extends Model
{ {
protected $dates = ['admin_seen']; protected $casts = [
'admin_seen' => 'datetime'
];
protected $guarded = []; protected $guarded = [];

View file

@ -26,7 +26,9 @@ class Status extends Model
* *
* @var array * @var array
*/ */
protected $dates = ['deleted_at']; protected $casts = [
'deleted_at' => 'datetime'
];
protected $guarded = []; protected $guarded = [];

View file

@ -22,7 +22,9 @@ class StoryItem extends Model
* *
* @var array * @var array
*/ */
protected $dates = ['expires_at']; protected $casts = [
'expires_at' => 'datetime'
];
protected $visible = ['id']; protected $visible = ['id'];

View file

@ -17,7 +17,11 @@ class User extends Authenticatable
* *
* @var array * @var array
*/ */
protected $dates = ['deleted_at', 'email_verified_at', '2fa_setup_at']; protected $casts = [
'deleted_at' => 'datetime',
'email_verified_at' => 'datetime',
'2fa_setup_at' => 'datetime'
];
/** /**
* The attributes that are mass assignable. * The attributes that are mass assignable.

View file

@ -178,7 +178,7 @@ class Inbox
switch($obj['type']) { switch($obj['type']) {
case 'Story': case 'Story':
StoryFetch::dispatchNow($this->payload); StoryFetch::dispatchSync($this->payload);
break; break;
} }

View file

@ -1,136 +1,56 @@
<?php <?php
use Stevebauman\Purify\Definitions\Html5Definition;
return [ return [
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Settings | Default Config
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| The configuration settings array is passed directly to HTMLPurifier. | This option defines the default config that is provided to HTMLPurifier.
| |
| Feel free to add / remove / customize these attributes as you wish. */
'default' => 'default',
/*
|--------------------------------------------------------------------------
| Config sets
|--------------------------------------------------------------------------
|
| Here you may configure various sets of configuration for differentiated use of HTMLPurifier.
| A specific set of configuration can be applied by calling the "config($name)" method on
| a Purify instance. Feel free to add/remove/customize these attributes as you wish.
| |
| Documentation: http://htmlpurifier.org/live/configdoc/plain.html | Documentation: http://htmlpurifier.org/live/configdoc/plain.html
| |
*/ | Core.Encoding The encoding to convert input to.
| HTML.Doctype Doctype to use during filtering.
'settings' => [ | HTML.Allowed The allowed HTML Elements with their allowed attributes.
| HTML.ForbiddenElements The forbidden HTML elements. Elements that are listed in this
/* | string will be removed, however their content will remain.
|-------------------------------------------------------------------------- | CSS.AllowedProperties The Allowed CSS properties.
| Core.Encoding | AutoFormat.AutoParagraph Newlines are converted in to paragraphs whenever possible.
|-------------------------------------------------------------------------- | AutoFormat.RemoveEmpty Remove empty elements that contribute no semantic information to the document.
|
| The encoding to convert input to.
|
| http://htmlpurifier.org/live/configdoc/plain.html#Core.Encoding
| |
*/ */
'configs' => [
'default' => [
'Core.Encoding' => 'utf-8', 'Core.Encoding' => 'utf-8',
'HTML.Doctype' => 'HTML 4.01 Transitional',
/*
|--------------------------------------------------------------------------
| Core.SerializerPath
|--------------------------------------------------------------------------
|
| The HTML purifier serializer cache path.
|
| http://htmlpurifier.org/live/configdoc/plain.html#Cache.SerializerPath
|
*/
'Cache.SerializerPath' => storage_path('purify'),
/*
|--------------------------------------------------------------------------
| HTML.Doctype
|--------------------------------------------------------------------------
|
| Doctype to use during filtering.
|
| http://htmlpurifier.org/live/configdoc/plain.html#HTML.Doctype
|
*/
'HTML.Doctype' => 'XHTML 1.0 Transitional',
/*
|--------------------------------------------------------------------------
| HTML.Allowed
|--------------------------------------------------------------------------
|
| The allowed HTML Elements with their allowed attributes.
|
| http://htmlpurifier.org/live/configdoc/plain.html#HTML.Allowed
|
*/
'HTML.Allowed' => env('RESTRICT_HTML_TYPES', true) ? 'HTML.Allowed' => env('RESTRICT_HTML_TYPES', true) ?
'a[href|title|rel|class],p[class],span[class],br' : 'a[href|title|rel|class],p[class],span[class],br' :
'a[href|title|rel|class],p[class],span[class],strong,em,del,b,i,s,strike,h1,h2,h3,h4,h5,h6,ul,ol,li,br', 'a[href|title|rel|class],p[class],span[class],strong,em,del,b,i,s,strike,h1,h2,h3,h4,h5,h6,ul,ol,li,br',
/*
|--------------------------------------------------------------------------
| HTML.ForbiddenElements
|--------------------------------------------------------------------------
|
| The forbidden HTML elements. Elements that are listed in
| this string will be removed, however their content will remain.
|
| For example if 'p' is inside the string, the string: '<p>Test</p>',
|
| Will be cleaned to: 'Test'
|
| http://htmlpurifier.org/live/configdoc/plain.html#HTML.ForbiddenElements
|
*/
'HTML.ForbiddenElements' => '', 'HTML.ForbiddenElements' => '',
/*
|--------------------------------------------------------------------------
| CSS.AllowedProperties
|--------------------------------------------------------------------------
|
| The Allowed CSS properties.
|
| http://htmlpurifier.org/live/configdoc/plain.html#CSS.AllowedProperties
|
*/
'CSS.AllowedProperties' => '', 'CSS.AllowedProperties' => '',
/*
|--------------------------------------------------------------------------
| AutoFormat.AutoParagraph
|--------------------------------------------------------------------------
|
| The Allowed CSS properties.
|
| This directive turns on auto-paragraphing, where double
| newlines are converted in to paragraphs whenever possible.
|
| http://htmlpurifier.org/live/configdoc/plain.html#AutoFormat.AutoParagraph
|
*/
'AutoFormat.AutoParagraph' => false, 'AutoFormat.AutoParagraph' => false,
/*
|--------------------------------------------------------------------------
| AutoFormat.RemoveEmpty
|--------------------------------------------------------------------------
|
| When enabled, HTML Purifier will attempt to remove empty
| elements that contribute no semantic information to the document.
|
| http://htmlpurifier.org/live/configdoc/plain.html#AutoFormat.RemoveEmpty
|
*/
'AutoFormat.RemoveEmpty' => false, 'AutoFormat.RemoveEmpty' => false,
'Attr.AllowedClasses' => [ 'Attr.AllowedClasses' => [
@ -176,7 +96,49 @@ return [
], ],
'URI.HostBlacklist' => config('costar.enabled') ? config('costar.domain.block') : [], 'URI.HostBlacklist' => config('costar.enabled') ? config('costar.domain.block') : [],
],
], ],
/*
|--------------------------------------------------------------------------
| HTMLPurifier definitions
|--------------------------------------------------------------------------
|
| Here you may specify a class that augments the HTML definitions used by
| HTMLPurifier. Additional HTML5 definitions are provided out of the box.
| When specifying a custom class, make sure it implements the interface:
|
| \Stevebauman\Purify\Definitions\Definition
|
| Note that these definitions are applied to every Purifier instance.
|
| Documentation: http://htmlpurifier.org/docs/enduser-customize.html
|
*/
'definitions' => Html5Definition::class,
/*
|--------------------------------------------------------------------------
| Serializer
|--------------------------------------------------------------------------
|
| The storage implementation where HTMLPurifier can store its serializer files.
| If the filesystem cache is in use, the path must be writable through the
| storage disk by the web server, otherwise an exception will be thrown.
|
*/
'serializer' => [
'driver' => env('CACHE_DRIVER', 'file'),
'cache' => \Stevebauman\Purify\Cache\CacheDefinitionCache::class,
],
// 'serializer' => [
// 'disk' => env('FILESYSTEM_DISK', 'local'),
// 'path' => 'purify',
// 'cache' => \Stevebauman\Purify\Cache\FilesystemDefinitionCache::class,
// ],
]; ];