freekmurze
Repos
136
Followers
4092
Following
16

Events

Laravel 8 Support Dropped

Hey there 👋

I noticed that in tag v1.13, Laravel 8 support was dropped, but this doesn't follow semantic versioning, was this intentional or should there be a tag for v2.0 for Laravel 9 and v1.13 for Laravel 8?

Many thanks!

Created at 33 minutes ago
Laravel 8 Support Dropped

Dropping support for a major version is ok for semantic versioning. Composer will not pull in a version of laravel-package-tools that doesn't work your old Laravel 8 app

Created at 33 minutes ago
freekmurze create tag 7.12.1
Created at 34 minutes ago
Update containsAll description

Thanks!

Created at 34 minutes ago

Update containsAll description (#233)

Created at 34 minutes ago
pull request closed
Update containsAll description
Created at 34 minutes ago
create tag
freekmurze create tag 1.1.2
Created at 57 minutes ago
issue comment
fixes socket_select interrupted exception

Thanks!

Created at 58 minutes ago

fixes #31

Merge pull request #32 from henzeb/socket_interrupted_issue

fixes socket_select interrupted exception

Created at 58 minutes ago
pull request closed
fixes socket_select interrupted exception

As described in #31, when using pcntl_signal, socket_select may get interrupted which will cause an ErrorException being thrown.

The message is: socket_select(): unable to select [4]: Interrupted system call.

With this fix, the ErrorException is catched, and when the error number is 4 (the interrupted system call), the while loop is continued and the socket_select is run again.

I have no tests, as this is very difficult to test as this appears to be occurring randomly. I have tested it manually however and the error seems to be gone. Also the existing unit tests still succeeds.

Created at 58 minutes ago
issue comment
Use field delimiter only for csv reader

Thanks!

Created at 7 hours ago

Use field delimiter only for csv reader

Merge pull request #111 from dehbka/use-delimeter-for-csv-reader

Use field delimiter only for csv reader

Created at 7 hours ago
pull request closed
Use field delimiter only for csv reader
Created at 7 hours ago
freekmurze create tag 3.0.4
Created at 19 hours ago
closed issue
Feature suggestion: Image Manipulation to read/add/change/remove JPEG metadata

I would like to write a new Image manipulation to work on JPEG metadata data (read/write EXIF/IPTC, etc. without recompression) using external binaries. I was wondering if extending Image was the right approach to it, or if I should separate that into something different. Most PHP image manipulation packages have no more than basic metadata reading features and the user is left on his own. EXIF/IPTC writing on manipulated image is a mandatory requirement of my project so I am not asking if that is a good or useful idea (nine of out of ten times you just want to strip everything out to lower the file payload). I am indeed asking

  • if you think extending Spatie/Image is a good choice
  • any suggestions on approaching the extension process
  • any suggestions on the actual manipulation process, I was thinking about invoking ExifTool which seems to be very powerful and has support for Mac, Linux and Windows
Created at 1 day ago
issue comment
Feature suggestion: Image Manipulation to read/add/change/remove JPEG metadata

Could be nice to have on spatie/image. Feel free to send a PR. If the API is clean, it doesn't involve too much code, tests are present, and docs are updated, I'll consider merging it in!

Unfortunately, I corrently don't have the time to assist with this.

Created at 1 day ago
pull request closed
Updated configure.php

Using a word "Laravel" for your package name is a terrible idea. This PR will prevent it from happening.

If you create a package and it's name containing a word "laravel", then publishing view files by running php artisan vendor:publish will cause you a problem.

For example, imagine you created a package named : Laravel-Viewtester. Then package-skeleton-laravel will generate something like LaravelViewtester/src/LaravelViewtesterServiceProvider.php.

Inside of this generated file will be like this:

class /LaravelViewtesterServiceProvider extends PackageServiceProvider
{
    public function configurePackage(Package $package): void
    {
        /*
         * This class is a Package Service Provider
         *
         * More info: https://github.com/spatie/laravel-package-tools
         */
        $package
            ->name('laravel-viewtester')
            ->hasConfigFile()
            ->hasViews();
    }
}

Now your package is ready and you install this package to new Laravel project by composer for testing. Everything seems OK, then you run php artisan vendor:publish. Your terminal shows that all those providers and tags. But instead of Tag: laravel-viewtester-views you see Tag: viewtester-views.

How come?

Because package-skelton-laravel uses laravel-package-tools, it publishes those view files by using these lines of code.

$this->publishes([
    $this->package->basePath('/../resources/views') => base_path("resources/views/vendor/{$this->package->shortName()}"),
], "{$this->package->shortName()}-views");

Now shortName() will remove 'laravel-' prefix from Package name.

public function shortName(): string
{
    return Str::after($this->name, 'laravel-');
}

Although you could publish your package view files, Laravel is not going to use it. Because Laravel tries to search resources/views/vendor/laravel-viewtester/*.blade.php first, but your published views are located in resources/views/vendor/viewtester/*.blade.php instead. So Laravel is not going to find them.

How this PR will prevent it?

When you run php ./configure.php and if you use "laravel" in your package name, this PR warns users try not to use "laravel" for your package name.

Hope this will prevent these mistakes happening again.

Created at 1 day ago
Updated configure.php

We use the word laravel for all our Laravel packages, and for us the skeleton works just fine. I don't mind that the tag to publish doesn't contain laravel-.

Feel free to fork this skeleton if you have another preference.

Created at 1 day ago
freekmurze create tag 1.15.0
Created at 2 days ago
pull request closed
Patch handling of multiple directories in config (nested)

ISSUE

When using multiple Directories in the config (as seen in readme::installation) routes get registered multiple times.

i.e. having a Structure like this:

App\Http\Controllers\
    SomeController.php
    Api\
        AnotherController.php

and using a config like:

...
'directories' => [
        app_path('Http/Controllers'),
        app_path('Http/Controllers/API') => [
            'prefix' => 'api',
        ],
]
...

it will result in the routes of AnotherController to get registered twice. once without the path prefix, and one time with the correct prefix

POC

sample from project i am currently working on

╰─❯ ./sail artisan route:list --name=location.getList                                                                                                                                                                                       

  GET|HEAD       api/locations .......................................................................................................................................... api.location.getList › API\Location\LocationApiController@locationsApi
  GET|HEAD       locations .............................................................................................................................................. api.location.getList › API\Location\LocationApiController@locationsApi

                                                                                                                                                                                                                              Showing [2] routes



PATCHED


╰─❯ ./sail artisan route:list --name=location.getList                              

  GET|HEAD       api/locations .......................................................................................................................................... api.location.getList › API\Location\LocationApiController@locationsApi

                                                                                                                                                                                                                              Showing [1] routes

config from sample

...
'directories' => [
        app_path('Http/Controllers'),
        app_path('Http/Controllers/API') => [
            'prefix' => 'api',
        ],
    ],
...

LocationsApiController has a route named "api.location.getList"

Purpose

This pull request tries to resolve that issue ( also makes some private methods protected... since everyone should be able to extend a software easily, not by copy pasting i.e. the whole ServiceProvider :) )

TODO:

  • [ ] ServiceProviderWithMultipleDirectoriesInConfigTest should not fail assertions ( maybe i am missing something in the test setup )
Created at 2 days ago
Patch handling of multiple directories in config (nested)

Closing due to inactivity.

Created at 2 days ago
Resource Attribute extended

Thank you very much!

Created at 2 days ago

Resources extended

Renamed test classes to clearer format

Update README.md

Link fixes in README

Requested fix to ResourceAttributeTest

Requested refinements to README

Update README.md

Expanded the explanation of the ApiResource attribute class

Merge pull request #93 from sirmathays/main

Resource Attribute extended

Created at 2 days ago
pull request closed
Resource Attribute extended

This pull request adds the support for two additional properties in Spatie\RouteAttributes\Attributes\Resource attribute class:

  • array|string|null $parameters
  • bool|null $shallow

Additionally, ApiResource attribute class was added just to make the Attribute declarations shorter when using named arguments.

// Before
#[Resource('posts', shallow: true, apiResource: true)]

// After
#[ApiResource('posts', shallow: true)]

Tests for all additions are included.

Created at 2 days ago
closed issue
BackupWasSuccessful event not firing in Laravel 9

Following the documentation I am trying to listen to the BackupWasSuccessful event but it does not fire. I am using version 9 of Laravel. How could I solve this problem?

protected $listen = [
      'Spatie\Backup\Events\BackupWasSuccessful' => [
            'App\Listeners\BackupWasSuccessfulListener',
   ],
];
Created at 2 days ago