Hi! If I use this package with my project I has a problem. My package.json has a "git dependency" like this:
{
"peerDependencies": {
"package": "git+ssh://git@bitbucket.org/team/project.git"
}
}
And npm-install-peers
breaks.
Repositories:
(706)
Labels:
(5)
findapr
good first issue
first issue
first pr
help wanted
Found 49 issues
First time here? 👋
Welcome to Find a PR.
Find a PR is an open-source site that is built to help developers find projects so that they can submit their very first pull request.
If you're a contributor looking to find a project to contribute to, feel free to browse through the list below.
If you're a maintainer looking to list your project on Find a PR, you can read how to do this in the documentation.
Hi! If I use this package with my project I has a problem. My package.json has a "git dependency" like this:
{
"peerDependencies": {
"package": "git+ssh://git@bitbucket.org/team/project.git"
}
}
And npm-install-peers
breaks.
JWo1F
18th Dec 2017 @ 08:52
I just installed package and complement for AI powered solution. When I create an issue to test it I get :
I had to change the links function like this to make it work for me:
public function links(): array
{
$rawText = Str::finish($this->rawText, 'ENDLINKS');
$textLinks = $this->between('LINKS', 'ENDLINKS', $rawText);
$textLinks = explode(PHP_EOL, $textLinks);
$links = [];
foreach ($textLinks as $textLink) {
$textLink = str_replace('\\', '\\\\', $textLink);
$textLink = str_replace('\\\\\\', '\\\\', $textLink);
$decodedLink = json_decode($textLink, true);
if ($decodedLink !== null) {
$links[$decodedLink['title']] = $decodedLink['url'];
}
}
return $links;
}
When I install the package in my project and use it with AI powered
1.0
8.2.14
11.14
Windows
No response
bestmomo
21st Jul 2024 @ 10:57
For some reason, our test suite is super slow. We should look into this and try to decrease memory usage and speed it up.
Parallel run:
Tests: 316 passed (785 assertions)
Duration: 13.64s
Parallel: 10 processes
Regular run:
Tests: 316 passed (785 assertions)
Duration: 96.30s
driesvints
29th Dec 2023 @ 10:43
11.7.0
8.3.7
PostgreSQL 15.7 and MySQL 8.0.37
When eager loading a model relationships, the results differ from when they are lazy loaded. This issue occurs whenever a Relation is called inside the definition of another Relation, but only when eager loading is used on the main one.
After investigation I realized that the cause lies in Illuminate\Database\Eloquent\Builder@eagerLoadRelation:
// First we will "back up" the existing where conditions on the query so we can
// add our eager constraints.
$relation = $this->getRelation($name);
$relation->addEagerConstraints($models);
// Then we will merge the wheres that were on the
// query back to it in order that any where conditions might be specified.
$constraints($relation);
Which calls the Illuminate\Database\Eloquent\Builder@getRelation method:
// We want to run a relationship query without any constraints so that we will
// not have to remove these where clauses manually which gets really hacky
// and error prone. We don't want constraints because we add eager ones.
$relation = Relation::noConstraints(function () use ($name) {
try {
return $this->getModel()->newInstance()->$name();
} catch (BadMethodCallException) {
throw RelationNotFoundException::make($this->getModel(), $name);
}
});
Which gets to the root cause of the problem in Illuminate\Database\Eloquent\Relations\Relation@noConstraints:
$previous = static::$constraints;
static::$constraints = false;
// When resetting the relation where clause, we want to shift the first element
// off of the bindings, leaving only the constraints that the developers put
// as "extra" on the relationships, and not original relation constraints.
try {
return $callback();
} finally {
static::$constraints = $previous;
}
The method Illuminate\Database\Eloquent\Relations\Relation@noConstraints is called during eager loading and uses a boolean attribute to manage the constraints. However, this flag is static and seems to be causing the where clauses of other relations to be omitted, leading to incorrect results.
// 0001_01_01_000000_create_users_table.php
Schema::create('categories', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('user_id');
$table->foreign('user_id')->references('id')->on('users');
$table->text('name');
$table->timestamps();
});
Schema::create('examples', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('category_id');
$table->foreign('category_id')->references('id')->on('categories');
$table->text('name');
$table->boolean('restricted');
$table->timestamps();
});
$user = User::factory()->create();
$categories = [
Category::query()->create(['user_id' => $user->id, 'name' => 'Category 1']),
Category::query()->create(['user_id' => $user->id, 'name' => 'Category 2']),
Category::query()->create(['user_id' => $user->id, 'name' => 'Category 3']),
];
Example::insert([
['category_id' => $categories[0]->id, 'name' => 'Example 1', 'restricted' => false],
['category_id' => $categories[1]->id, 'name' => 'Example 2', 'restricted' => true],
['category_id' => $categories[2]->id, 'name' => 'Example 3', 'restricted' => false],
['category_id' => $categories[2]->id, 'name' => 'Example 4', 'restricted' => false],
['category_id' => $categories[2]->id, 'name' => 'Example 5', 'restricted' => true],
]);
User::factory()->create(); // another user just for demonstration
class Example extends Model
{
// ...
/**
* The authenticated user should only have access to not restricted Examples
* or to the examples he owns.
*/
public function scopeHasAccess(Builder $query, ?User $user = null): Builder
{
return $query->where(
fn ($query) => $query->where('restricted', false)
->when(
$user !== null,
fn($query) => $query->orWhereIn('category_id', $user->categories->pluck('id'))
)
);
}
}
class User extends Authenticatable
{
// ...
public function categories(): HasMany
{
return $this->hasMany(Category::class);
}
}
class Category extends Model
{
// ...
public function examples(): HasMany
{
return $this->hasMany(Example::class);
->hasAccess(Auth::user());
}
}
Auth::login(User::find(1));
// Auth::login(User::find(2));
dump('Authenticated user: '.Auth::user()->id);
Category::get()->each(
fn(Category $category) => dump(sprintf('- %s: %d examples', $category->name, $category->examples->count()))
);
// Authenticated user: 1
// - Category 1: 1 examples"
// - Category 2: 1 examples"
// - Category 3: 3 examples"
// ----------------------------
// Authenticated user: 2"
// - Category 1: 1 examples"
// - Category 2: 0 examples"
// - Category 3: 2 examples"
dump('Authenticated user: '.Auth::user()->id);
Category::with('examples')->get()->each(
fn(Category $category) => dump(sprintf('- %s: %d examples', $category->name, $category->examples->count()))
);
// Authenticated user: 1
// - Category 1: 1 examples"
// - Category 2: 1 examples"
// - Category 3: 3 examples"
// ----------------------------
// Authenticated user: 2"
// - Category 1: 1 examples"
// - Category 2: 1 examples"
// - Category 3: 3 examples"
Expected behavior: The fetched relations should be consistent regardless of whether they are lazy or eager loaded.
Actual behavior:
allandantasdev
18th Jun 2024 @ 08:10
Im using PHPFlasher in a symfony application however it adds session state when not in use. I am combining it with API Platform and my API itself it stateless so it should not hold any session data (causes errors).
How should i handle this (if even possible?)
pimjansen
2nd Jun 2023 @ 12:24
2.3.12
11.9.2
8.3.0
Roadrunner
2024.1.2
No response
When streaming a response from a route behind Octane, the response gets buffered and arrives all at once instead of as it is generated.
Currently, wire:stream
in Livewire is completely broken when using Laravel Octane, but the issue is not specific to Livewire and my instructions below use native Laravel and vanilla JavaScript only.
I have created a minimal reproduction repository. Follow the instructions in the README to observe the behaviour of artisan serve
as opposed to Octane. There is a small amount of JavaScript in welcome.blade.php
that sends the request and outputs the chunks in real time.
Here is the response, note the sleep(1)
calls to simulate an artificial delay in receiving the stream chunks. When using artisan serve
, there is a second delay between each number appearing. When using Octane, there is a 5 second delay before all numbers appear at once.
return response()->stream(function () {
echo 1;
ob_flush();
flush();
sleep(1);
echo 2;
ob_flush();
flush();
sleep(1);
echo 3;
ob_flush();
flush();
sleep(1);
echo 4;
ob_flush();
flush();
sleep(1);
echo 5;
}, 200, [
'Content-Type' => 'text/html; charset=utf-8;',
'Cache-Control' => 'no-cache',
'X-Accel-Buffering' => 'no',
]);
danharrin
4th Jun 2024 @ 11:40
Flash messages are being stored in the session but are not showing up on the screen. They keep getting added with each request. The messages are not being rendered to the user.
codebyshami
28th Jun 2024 @ 18:29
11.16.0
8.3.9
MariaDB 11.4.2
When using pagination with ResourceCollection
while Model::preventAccessingMissingAttributes()
is activated, an attempt to access resource
attributes occurs. This access results in a violation of the prevent access to missing attributes policy, causing an exception to be thrown.
"message": "The attribute [resource] either does not exist or was not retrieved for model [App\\Models\\User].",
"exception": "Illuminate\\Database\\Eloquent\\MissingAttributeException"
php artisan db:seed
AppServiceProvider
add in the register method this Model::shouldBeStrict();
or this Model::preventAccessingMissingAttributes();
php artisan make:resource UserCollection
return new UserCollection(User::paginate());
Karem-sobhy
21st Jul 2024 @ 16:10
I found some issues after the version 2 upgrade on Laravel 11:
If version 2 main concept is to replace the default Laravel flash without an option to disable it, I know that downgrading should be the proper solution but unfortunately, this also will not be a good solution because version 1 with Laravel 11 disables the default flash option entirely and also have to rewrite a lot of code to change it to php-flasher and that why I upgraded to version 2 in the first place.
AhmedGamal
22nd May 2024 @ 19:31
When I try to add a password-protected PDF file to the library, I get an exception indicating that the file is protected:
This file requires a password for access
Sans84
5th Jul 2024 @ 12:48
Add code snippets for each block
willemvb
25th Jul 2016 @ 12:49
After installation, I noticed that in the browser console it outputs an error of wireEl is undefined.
Just install this package in a livewire project, preferable with Filament's admin package. And see the browser console.
composer create-project laravel/laravel test;
composer require filamentphp/filament;
composer require spatie/laravel-blade-comments;
Then go through the browser console and see the error
1.0.1
8.2.0
10.13.0
macOS
Filament ......................................................
Packages ...... filament, forms, notifications, support, tables
Version .............................................. v2.17.44
Views ..................................... PUBLISHED: filament
sawirricardo
2nd Jun 2023 @ 07:15
Hi,
I have an issue in my dockerized Laravel 10 app and flasher 1.15.3
. The issue is that notifications are not displayed when I'm using something like this:
public function customRoute(Request $request): RedirectResponse
{
// action
flash()->addSuccess('Success notification.');
return redirect()->back();
}
When I'm redirecting notification won't be displayed, but when directly returning view it works. It behaves like that because of this part of code in your package:
final class StorageBag implements StorageInterface
{
/**
* @var BagInterface
*/
private $bag;
public function __construct(BagInterface $bag = null)
{
$this->bag = null !== $bag && 'cli' !== \PHP_SAPI ? $bag : new ArrayBag();
}
especially this 'cli' !== \PHP_SAPI
because since we are using docker our app is in CLI mode. Can anoyone tell my why this PHP_SAPI check has to be present here?
forexknight
13th Sep 2023 @ 05:19
Laravel : phpflasher
I am using https://php-flasher.io/
for flash notification in laravel project.
and for add product to cart i am sending the falsh to show successful message
it works fine it shows up the flash notification
error : But teh flash Toast comes back if you navigate away and return back to the page again
is there any solution there.
sanzgrapher
3rd Jul 2024 @ 06:24
No response
Add option for encrypted backups
When creating a backup task, there should be an option to type in a password that encrypts the backup for security.
v1.4.1
No response
No response
No response
lewislarsen
26th Jul 2024 @ 21:24
Dusk was added a few weeks ago and I will slowly be adding Dusk tests to the project piece by piece.
Contributions to this would be helpful as I'd like to get as much tested with Dusk as possible.
lewislarsen
26th Jul 2024 @ 21:43
I would be good to support normalizer_get_raw_decomposition function that appeared in PHP 7.3. I've tried to implement it but seems that existing decomposition data is already optimized to get the final decomposition. Example test case is available here.
Pinging @nicolas-grekas as he is the author of Normalizer
polyfill.
IonBazan
12th May 2018 @ 23:26
When attempting to filter tests by test or file name pressing the "Enter" key has no effect.
Pressing "Enter" at the default screen correctly triggers a "test run" where all tests are run.
ntwb
25th Feb 2018 @ 10:49
Figure our a way to show a grayed out Laravel logo as a default avatar instead of the current default GitHub one.
driesvints
29th Sep 2021 @ 10:48
Found the \Illuminate\Database\Eloquent\Concerns\HasAttributes::originalIsEquivalent()
method during code diving and it should be usable for our trait! 🎉
This PR would be mainly reasearch when that method was added, if it's compatible with our version support rules and switching our own change detection logic with the core one.
Gummibeer
20th Oct 2021 @ 10:03
Describe the bug
logUnguarded()
works provided that $guarded
is set explicitly in the model. If it is not set explicitly but globally set, say in AppServiceProvider
using Model::unguard();
then nothing is logged.
To Reproduce
$fillable
and $guarded
from a model that use uses LogsActivity
Model::unguard();
in AppServiceProvider
in the boot
method public function getActivitylogOptions() : LogOptions
{
return LogOptions::defaults()->logUnguarded();
}
Expected behavior Some changed properties should be logged but none are
Versions (please complete the following information)
colinmackinlay
20th Nov 2022 @ 12:31
In raising this issue, I confirm the following (please check boxes):
One of the important reasons for using hyperscript is that it handles escaping of characters which are reserved in html. Which prevents XSS.
spatie/html-element does not do this. Mainly because it uses strings as intermediate format instead of an object representation of the DOM.
Erikvv
1st Feb 2018 @ 02:19
AST, or "abstract syntax tree", creates the expectation of a nested tree structure. In the case of a query string, the AST will only ever be one level deep; as multi nodes are combined into one.
If anyone wants to suggest a better, more clear name: you're welcome.
brendt
20th Dec 2018 @ 13:41
We are logging activity of several models, some using SoftDeletes trait and others not.
When we set config option 'subject_returns_soft_deleted_models' => true
then calling subject()
on any model not using SoftDeletes trait throws an exception: Call to undefined method Illuminate\Database\Eloquent\Builder::withTrashed()
.
Can the subject()
method below be made to check first whether the Model uses the SoftDeletes trait? Or perhaps check whether withTrashed()
is a defined method on the Model? I tried a few things but couldn't figure out how to get the class of the Model..
bluec
7th Nov 2018 @ 13:44
When encountering nested tokens, they are parsed only during formatting, not when compiling the pattern. And the type of tokens are validated only during the rendering as well. But the native implementation detects such error during the instantiation: https://3v4l.org/Sf69D This means that the error handling required for the polyfill is not the same than for the native implementation.
stof
23rd Oct 2018 @ 15:58
No response
GitLab Sign-in Support
People will be able to login with GitLab, very similarly to the current GitHub integration.
v1.4.1
No response
No response
No response
lewislarsen
26th Jul 2024 @ 21:23
v2.3.10
v11.6.0
v8.3.6
FrankenPHP
v1.1.4 PHP 8.3.6 Caddy v2.7.6
Postgress
Last week we updated our app previously using php-fpm
running on Forge to use Laravel Octane with FrankenPHP. Our site is mostly an API that handles analytics events (Like google analytics). It uses the default Laravel api
throttling.
In staging our app worked fine (30 req/sec same IP), but when deploying to production (1400 req/sec, different IPs) it started to fail, giving a lot of 429 Too Many Requests.
I quickly rolled back to php-fpm
and after a few hours tried again with the same problem. Rolled back and the next day I switched to Swoole and it worked perfectly without changing a single line of code nor having to redeploy anything. So I can confidently say that is NOT a bug in my code, but rather a bug with FrankenPHP or the Octane integration with FrankenPHP.
My theory is that the RateLimiter is not reseting between requests so it's shared between different users. So multiple different users trigger the rate limiter:
This is my Rate limiter configuration:
// AppServiceProvider
RateLimiter::for('api', function (Request $request) {
return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
});
our production CACHE_STORE
is redis
. Throttling worked perfectly fine without octane and with octane but using Swoole. It failed with hundred of 429 Too Many Requests after installing FrankenPHP.
This is our bootstrap/app.php
:
<?php
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
use Illuminate\Support\Facades\App;
return Application::configure(basePath: dirname(__DIR__))
->withRouting(
commands: __DIR__.'/../routes/console.php',
health: '/up',
then: function () {
Route::middleware('api')
->prefix('api')
->as('api.')
->domain(config('app.domain'))
->group(base_path('routes/api.php'));
Route::middleware('web')
->domain(config('app.domain'))
->group(base_path('routes/web.php'));
Route::middleware('web')
->domain(config('playsaurus.ads.domain'))
->group(base_path('routes/ads.php'));
}
)
->withMiddleware(function (Middleware $middleware) {
$middleware->throttleApi();
$middleware->redirectTo(
guests: '/login',
users: '/',
);
$middleware->web(append: [
\App\Http\Middleware\HandleInertiaRequests::class,
\Illuminate\Http\Middleware\AddLinkHeadersForPreloadedAssets::class,
]);
$middleware->api(append: [
\App\Http\Middleware\ConfigureLocale::class,
]);
$middleware->alias([
'localize' => \App\Http\Middleware\ConfigureLocale::class,
'embed' => \App\Http\Middleware\AllowsEmbeding::class,
]);
})
->withExceptions(function (Exceptions $exceptions) {
$exceptions->dontReport([
\App\Services\Announcements\InvalidVariantKey::class,
\App\Exceptions\CouponRedeemException::class,
]);
})->create();
It's difficult to reproduce. Because I can't test it in production because that would mean a lot of downtime for our users.
My theory is that it would be possible to reproduce from multiple different IPs. But since I don't have the means to test it, I don't know.
jhm-ciberman
14th May 2024 @ 00:15
The goal is to make abstract code based on the package notorm to build a new orm system
ambroisehdn
15th Jun 2022 @ 12:34
No response
Add an API
This is a rather long term goal, but Vanguard should support an API so users can trigger backup tasks to run remotely.
This will be a significant undertaking as the current system wasn't built with an API in mind, mainly lots of Livewire components triggering actions, as opposed to discrete Action classes.
v1.4.1
No response
No response
No response
lewislarsen
26th Jul 2024 @ 21:27
When calling mb_convert_encoding()
with $fromEncoding === 'HTML-ENTITIES'
, the polyfill does not return functionally equivalent strings to the native function. This is because mb_convert_encoding()
uses html_entity_decode()
when $fromEncoding === 'HTML-ENTITIES'
and that function does not return characters for many numeric entities 0-31 and 127-159. For example:
<?php
require "vendor/symfony/polyfill-mbstring/Mbstring.php";
use Symfony\Polyfill\Mbstring as p;
for($i = 0; $i < 1024; $i++) {
$string = "&#" . $i . ";";
$mbstring = mb_convert_encoding($string, 'UTF-8', 'HTML-ENTITIES');
$polyfill = p\Mbstring::mb_convert_encoding($string, 'UTF-8', 'HTML-ENTITIES');
if($mbstring != $polyfill) {
echo "Mismatch: $string - mbstring: $mbstring; polyfill: $polyfill\n";
}
}
outputs:
Mismatch: � - mbstring: ; polyfill: �
Mismatch:  - mbstring: ; polyfill: 
Mismatch:  - mbstring: ; polyfill: 
Mismatch:  - mbstring: ; polyfill: 
Mismatch:  - mbstring: ; polyfill: 
Mismatch:  - mbstring: ; polyfill: 
Mismatch:  - mbstring: ; polyfill: 
Mismatch:  - mbstring: ; polyfill: 
Mismatch:  - mbstring:; polyfill: 
Mismatch:  - mbstring:
; polyfill: 
Mismatch:  - mbstring:
; polyfill: 
Mismatch:  - mbstring: ; polyfill: 
Mismatch:  - mbstring: ; polyfill: 
Mismatch:  - mbstring: ; polyfill: 
Mismatch:  - mbstring: ; polyfill: 
Mismatch:  - mbstring: ; polyfill: 
Mismatch:  - mbstring: ; polyfill: 
Mismatch:  - mbstring: ; polyfill: 
Mismatch:  - mbstring: ; polyfill: 
Mismatch:  - mbstring: ; polyfill: 
Mismatch:  - mbstring: ; polyfill: 
Mismatch:  - mbstring: ; polyfill: 
Mismatch:  - mbstring: ; polyfill: 
Mismatch:  - mbstring: ; polyfill: 
Mismatch:  - mbstring: polyfill: 
Mismatch:  - mbstring: ; polyfill: 
Mismatch:  - mbstring: ; polyfill: 
Mismatch:  - mbstring: ; polyfill: 
Mismatch:  - mbstring: ; polyfill: 
Mismatch: ' - mbstring: '; polyfill: '
Mismatch:  - mbstring: ; polyfill: 
Mismatch: € - mbstring: ; polyfill: €
Mismatch:  - mbstring: ; polyfill: 
Mismatch: ‚ - mbstring: ; polyfill: ‚
Mismatch: ƒ - mbstring: ; polyfill: ƒ
Mismatch: „ - mbstring: ; polyfill: „
Mismatch: … - mbstring:
; polyfill: …
Mismatch: † - mbstring: ; polyfill: †
Mismatch: ‡ - mbstring: ; polyfill: ‡
Mismatch: ˆ - mbstring: ; polyfill: ˆ
Mismatch: ‰ - mbstring: ; polyfill: ‰
Mismatch: Š - mbstring: ; polyfill: Š
Mismatch: ‹ - mbstring: ; polyfill: ‹
Mismatch: Œ - mbstring: ; polyfill: Œ
Mismatch:  - mbstring: ; polyfill: 
Mismatch: Ž - mbstring: ; polyfill: Ž
Mismatch:  - mbstring: ; polyfill: 
Mismatch:  - mbstring: ; polyfill: 
Mismatch: ‘ - mbstring: ; polyfill: ‘
Mismatch: ’ - mbstring: ; polyfill: ’
Mismatch: “ - mbstring: ; polyfill: “
Mismatch: ” - mbstring: ; polyfill: ”
Mismatch: • - mbstring: ; polyfill: •
Mismatch: – - mbstring: ; polyfill: –
Mismatch: — - mbstring: ; polyfill: —
Mismatch: ˜ - mbstring: ; polyfill: ˜
Mismatch: ™ - mbstring: ; polyfill: ™
Mismatch: š - mbstring: ; polyfill: š
Mismatch: › - mbstring: ; polyfill: ›
Mismatch: œ - mbstring: ; polyfill: œ
Mismatch:  - mbstring: ; polyfill: 
Mismatch: ž - mbstring: ; polyfill: ž
Mismatch: Ÿ - mbstring: ; polyfill: Ÿ
While many of these are control characters (and the native function does return them), the single quote (dec 39) is particularly problematic.
cpeel
18th Mar 2021 @ 04:11
Hi,
With the polyfill, var_dump(mb_strlen(chr(254)))
return 0
.
With the php8.0-mbstring extension, var_dump(mb_strlen(chr(254))) return 1
;
versions : * v1.26.0
Thanks, Alex
alexchuin
18th Oct 2022 @ 12:51
Hello,
I noticed that there is an incompatibility with the mbstring polyfill and PHP 8.1 / Alpine Linux, which breaks a lot of my projects as soon as the php81-mbstring is not installed, but php81-iconv is installed:
Example:
Warning: iconv(): Wrong encoding, conversion from "ASCII" to "UTF-8//IGNORE" is not allowed in phar:///var/www/localhost/htdocs/phpstan.phar/vendor/symfony/polyfill-mbstring/Mbstring.php on line 736
It looks like //IGNORE
is not accepted since echo iconv('UTF-8', 'UTF-8', 'test');
works, while echo iconv('UTF-8', 'UTF-8//IGNORE', 'test');
doesn't
danielmarschall
7th Jan 2022 @ 00:12
Add in PHP 7.3 as Normalizer::normalize() argument for NFKC_Casefold normalization.
nicolas-grekas
7th Feb 2019 @ 10:11
11.13.0
8.3.6
No response
Hello. I change user agent in Http::globalRequestMiddleware
like below according to this link:
Http::globalRequestMiddleware(fn ($request) => $request->withHeader(
'User-Agent', 'Example Application/1.0'
));
When I use RequestSending
event like the example in document I get another user agent:
public function LogHttpClientRequests(RequestSending $event)
{
Log::info('Request Sending Headers:', $event->request->headers());
}
I get GuzzleHttp/7
in log file:
local.INFO: Request Sending Headers: {"User-Agent":["GuzzleHttp/7"]}
The expected User-Agent is Example Application/1.0. This happens with any modifications in header. The request that is actually get sent has the correct User Agent but the log shows invalid output. How can I get this fixed?
1- Create app/Providers/HttpClientServiceProvider.php
:
public function register(): void
{
}
public function boot(): void
{
Http::globalRequestMiddleware(fn ($request) => $request->withHeader(
'User-Agent',
'Example Application/1.0'
));
}
2- Register event in app/Providers/EventServiceProvider.php
:
protected $listen = [
RequestSending::class => [
LogHttpClientRequests::class,
],
ResponseReceived::class => [
LogHttpClientRequests::class,
],
ConnectionFailed::class => [
LogHttpClientRequests::class,
],
];
3- Create app/Listeners/LogHttpClientRequests.php
:
public function LogHttpClientRequests(RequestSending $event): void
{
Log::info('Request Sending Headers:', $event->request->headers());
}
4- Run Http::get('https://example.com')
in tinker.
sky93
1st Jul 2024 @ 23:31
Originally posted by indyjonesnl January 10, 2024
$lodgingBusiness = Schema::lodgingBusiness()
->openingHours(
Schema::openingHoursSpecification()
->dayOfWeek([Schema::dayOfWeek()::Monday])
->opens(new DateTime('09:00:00'))
->closes(new DateTime('17:00:00'))
)
->checkinTime(new DateTime('14:00:00'))
->checkoutTime(new DateTime('11:00:00'))
This results in the current date + time being included in the output "opens":"2024-01-10T09:00:00+00:00","closes":"2024-01-10T17:00:00+00:00"
and ..."checkinTime":"2024-01-10T14:00:00+00:00","checkoutTime":"2024-01-10T11:00:00+00:00"...
While the Schema should contain only the time, formatted as 14:30:00+08:00
.
Can someone point me in the right direction?
Gummibeer
11th Jan 2024 @ 13:12
2.6.2
11.16.0
8.3.6
Swoole
5.1.2
No response
Before i start, this is not a duplicate to https://github.com/laravel/octane/issues/903, this is about Swoole. Also large stream responses are fixed with https://github.com/laravel/octane/issues/636, but not this case.
While using Storage::download or Storage::response, laravel is creating a stream response that uses php fpassthru($stream). Somehow the buffering between fpassthru and ob_start does not work, instead it tries to load the full file into the memory. This leads to out of memory errors while downloading very big files.
If i replace the fpassthru with a fread-while-loop it is working as expected.
I can basically make a pull request, but need help with the solution... Is this more a problem in the laravel framework or PHP itself?
NiroDeveloper
24th Jul 2024 @ 11:18
I'm using Laravel 10. I've installed the package via "composer require php-flasher/flasher-laravel" Now I'm able to fire flash messages in my controller. I see them in the session data (in flasher::envelopes). But they aren't showing up in my views. In my config file I have 'auto_render' => true. If I put @flasher_render in my blade view, the only thing that's happens is, a notification to warn that this method wil be deprecated.
How can I fix this? I really like to use this package ;-)
krisc78
9th Mar 2023 @ 14:49
Currently, for plural rules, the MessageFormatter polyfills uses the English rules for all locales (it ignores the locale).
To be consistent with what we do in symfony/intl
(used by symfony/polyfill-intl-icu
to implement NumberFormatter and DateFormatter), we should rather fail explicitly here (using the English rules for a different locale would not give the right result anyway)
stof
23rd Oct 2018 @ 15:34
Calling for help from Docker experts. We need to create the best possible docker-compose.yml
file for this project. The application requirements are well defined (we use env vars, Webpack Encore, PHP 7.1, Symfony 4.1, SQLite database, etc.) so it should be possible to create that file.
javiereguiluz
21st May 2018 @ 09:37
protected $listeners = [
'sweetalertConfirmed',
'sweetalertDenied',
];
public function logout()
{
sweetalert()
->timer(0)
->showDenyButton()
->addInfo('confirm or deny action');
}
public function sweetalertConfirmed(array $payload)
{
auth()->logout();
sweetalert()->addSuccess('sweetalert was confirmed');
}
public function sweetalertDenied(array $payload)
{
sweetalert()->addError('sweetalert was denied');
}
i have code for laravel 10 and livewire 3 and get Uncaught TypeError: Livewire.components is undefined when i click button logout, here my button logout:
<a wire:click.prevent="logout" href="#" class="nav_link" data-bs-toggle="tooltip" data-bs-title="Logout">
<i class='bx bx-log-out nav_icon'></i>
<span class="nav_name">Logout</span>
</a>
how can fix this code
andhikapepe
12th Dec 2023 @ 05:38
public function bell()
{
$this->count += 1;
flash()->addInfo('Your information has been saved and a confirmation email has been sent.');
}
This flash message doesn't show up until I reload the page If I reload the page then what's is the point of using livewire
codebyshami
17th Nov 2023 @ 01:19
No response
Option to disable registration feature
There should be a configuration toggle in the .ENV
file that allows people to disable registration.
When toggled, there should be a message on /register stating that registration is disabled.
v1.3.2
No response
No response
No response
lewislarsen
15th Jul 2024 @ 20:35
Let's put something more beautiful here than the current layout. Maybe something similar than the Tailwind UI empty state pages.
https://tailwindui.com/components/application-ui/feedback/empty-states
driesvints
12th Mar 2024 @ 10:20
10.x and 11.x
8.1, 8.2 and 8.3
No response
When a Bus::chain
contains a job with a readonly promoted non-scalar property, only the first job or batch in the chain is executed. The subsequent jobs or batches appear to be discarded. Additionally, even if the chain is dispatched on a non-default queue, the jobs still run on the default queue.
No exceptions were found in the logs.
Laravel versions: 10.x and 11.x PHP versions: 8.1, 8.2, and 8.3
Failing test PR : #51878 A repository that reproduces the problem can be found here: https://github.com/shaffe-fr/framework/commit/f1b3cad6d6e3a78d108f25d751d144049e070626
Here is a screenshot illustrating the issue:
Bus::chain
with at least one job having a readonly promoted non-scalar property.shaffe-fr
21st Jun 2024 @ 13:40
2.3.4
10.46.0
8.2.20
Swoole
5.1.1
No response
When the server runs out of memory, swoole is restarted after a restart of the server. Swoole thinks that the process should still be active because the PID is still in the octane-server-state.json, but this process ID doesn't exist anymore. Then in line 22-24 of src/Swoole/SwooleExtension.php it tries to kill a PID which doesn't exist anymore, receives a Operation not permitted[1] error and crashes the process, which is not started anymore.
Pluuk
1st Jul 2024 @ 07:31
No response
Add Telegram Support
Users will be able to create a Telegram focused Notification Stream, allowing for backup task notifications to be sent via Telegram bot.
v1.4.1
No response
No response
No response
lewislarsen
26th Jul 2024 @ 21:22
Describe the bug
I have a table which has an order
column. When I reorder the elements I update each model with the new order.
Because the table has some large JSON columns I select only id
and order
columns for efficiency. I set the new order and save the model.
foreach (Faq::query()->get(['id', 'order']) as $faq) {
$faq->order = $newOrder[$faq->id];
$faq->save();
}
The diffs created in the activity_log
table look like this:
{
"old": {
"order": 1,
"answer": null,
"question": null
},
"attributes": {
"order": 2,
"answer": "long JSON content",
"question": "long JSON content"
}
}
From what I see laravel-activitylog fetches the model with all columns from the database before creating a log entry which kind of defeats the purpose of my "select list optimization" and produces an incorrect diff.
Generally I want these large JSON columns to be logged in case a user changes them but in this case I only change the order
column so I would like to see only the order
column in the diff.
I have tried running these updates straight off the Eloquent builder:
Faq::query()->where('id', $id)->update(['order' => $newOrder[$id]]);
but in this case nothing is logged.
I have the following activitylog configuration for my models:
public function getActivitylogOptions(): LogOptions
{
return LogOptions::defaults()
->logAll()
->logOnlyDirty()
->logExcept([
'id',
'created_at',
'updated_at',
]);
}
To Reproduce Select a subset of columns from the database, change these columns, save the model and see that other (not initially selected) columns are present in the diff.
Expected behavior Only columns that've actually been changed should be present in the diff.
Versions
KKSzymanowski
28th Sep 2022 @ 21:53
11.11.1
8.3.8
No response
Closure in job Bus::chain is not called if it is after Bus::batch - exception is thrown but there is nothing in failed jobs.
Call to undefined method Closure::getClosure() {"exception":"[object] (Error(code: 0): Call to undefined method Closure::getClosure() at /home/eldair/code/bus_chain_test/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedClosure.php:107)
Batch setup
$batch = [];
for ($i=0; $i < 5; $i++) {
$batch[] = new BatchJob($i + 1);
}
This will throw the exception and the closure will not be called
Bus::chain([
new ChainedJob,
Bus::batch($batch),
function () {
logger('after batch');
}
])->dispatch();
This works fine
Bus::chain([
new ChainedJob,
Bus::batch($batch),
new ChainedJob,
function () {
logger('after batch');
}
])->dispatch();
Here is the reproduction repo https://github.com/eldair/bus_chain_test/tree/main, nothing was added except two jobs and console command to call the code above.
eldair
24th Jun 2024 @ 17:25
We welcome contributions adding additional languages to Vanguard.
The danish language has full coverage, from what I've seen, so please copy that file and translate into your intended language and open a PR.
Any language corrections should also be via PR.
I recommend reading this section of the docs for how Vanguard handles internationalization.
Thank you!
lewislarsen
26th Jul 2024 @ 21:34