Comments (14)
Hello
What version of Laravel do you use?
Does it work with the show method?
from laravel-hashslug.
I am using 5.5 and I am using the show
method, that's where it gives me error. Also gives error on edit
method with public function edit(Task $task)
from laravel-hashslug.
How does the relevant part of your route file look like?
from laravel-hashslug.
Here is how:
Here is complete method:
// edit page
public function edit(Task $task)
{
title('Edit Task');
return view('task::pages.task.edit', compact('task'));
}
from laravel-hashslug.
Are you using Route::resource
?
from laravel-hashslug.
That's true.
from laravel-hashslug.
Is the SubstituteBindings
middleware loaded?
from laravel-hashslug.
How can i verify that ? I only added use HasHashSlug;
to my model, did nothing else.
from laravel-hashslug.
One way to make it sure is putting a dummy echo or dd()
to the handle method of vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php
from laravel-hashslug.
Yes it is being called when i put dd there.
from laravel-hashslug.
Then I honestly have no idea, it's some laravel weirdness, maybe some interference with laravel modules.
Use this format, this will work for sure:
public function show($slug){
$task = Task:findBySlugOrFail($slug);
}
from laravel-hashslug.
No problem, thanks, yes maybe laravel modules package is doing something weiried. FYI, I was using this package in my laravel starter here: https://github.com/sarfraznawaz2005/laravel55-starter
Maybe you should try on fresh installation of Laravel 5.5, could be issue with 5.5.
from laravel-hashslug.
Verified that it works with fresh installation of Laravel, so some other package I am using is doing the trick. Thanks for your help anyways.
from laravel-hashslug.
Found out, I was using FakeID package previously: https://github.com/Propaganistas/Laravel-FakeId and I forgot to remove its service provider registration. Thanks
from laravel-hashslug.
Related Issues (9)
- Enabling / Disabling HOT 4
- Laravel version HOT 5
- Slug length in config HOT 4
- Return slug by Controller HOT 1
- Should create a default config file HOT 4
- Is possiable to support whereSlug or whereSlugIn method? HOT 2
- Soft deleted models return 404 HOT 1
- Accessor HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-hashslug.