laravel-shareable-models: route is not working

There are some problems with documentation.

  1. the entry to be put in the routes file has a typo:
Route::get('shared/{shareable_link}', ['middleware' => 'shared', function (ShareableLink $link) {
    return $link->shareable;
});

A closing bracket ] is missing.

  1. the route doesn’t work anyway. To be honest I have no idea why. I tried to link the route to middleware using an alternative syntax
Route::get('shared/{shareable_link}', function (Sassnowski\LaravelShareableModel\Shareable\ShareableLink $link) {
    return 'test OK';
})->middleware('shared');

But to no result.

Maybe you could run the package on a clean new instance of Laravel 5.5?

  1. In docs here https://ksassnowski.gitbooks.io/shareable-models/content/getting-started.html it would be nicer if you mention that the user should declare the class in the header of the controller file: use Sassnowski\LaravelShareableModel\Shareable\ShareableLink;

The package should be great, anyway! Thank you.

Peter

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 37 (18 by maintainers)

Most upvoted comments

Glad to hear its working now. I tagged version 2.0.0 just now.

Regarding your points:

  • I moved doctrine/dbal to the dev dependencies since its needed to drop columns on sqlite databases
  • You can configure the base url in config by changing the base_url key.

Kai

Can you try if

app()->make(HashidsInterface::class)->encodeHex('aa');

returns a hash? You might be running into a PHP_MAX_INT error where the generated UUID is too large for your system to handle.