Comments (21)
I just tried it with L5.4 and it works as expected. Going to test with L5.2 and let you know
from comments.
Just tried with L5.2.31 and it works as expected. No errors. Have you followed the readme on Installation?
from comments.
Yes I have. Entirely possible I did something wrong.
Have you ever seen a situation where the POST request turns into a GET request for no reason? that seems to be what is happening. Everything else is working.
from comments.
When you post a comment two request are made.
- One is a POST request that sends the data.
- The other is a GET request that loads the comments.
Are you using this syntax in your view to declare your content_type class?
@include('comments::comments-react', [
'content_type' => App\Book::class,
'content_id' => $book->id
])
Try creating a new laravel application, install the package and follow the readme. Then, you can compare what is different in your application. I have tried with L5.2 and 5.4, and it works without a glitch.
I will be making a video tutorial on how to install this package, maybe that will help you.
P.S. Have you entered the models that can be commented upon in the config?
from comments.
If I get the opportunity yes I will do that.
For now I am going to write a vanilla/jQuery adapter for the endpoint. It occured to me that it might be a bit dangerous to deploy a React-based product when I'm not that good at React... Maybe I'll even do a PR if it's something that could be folded in.
The one thing I will say before moving on is that the initial GET to http://www.xxx.com/api/v1/comments?content_type=App%5CModels%5CExpense&content_id=39 works fine. So that seems to imply that my config is correct. It's just the POSTing of the comment that seems screwy. It really looks like it turns into a param-less GET request. It does seem likely that it's a conflict with something on our end; if I trip over it I will let you know. Thanks.
from comments.
Hey I figured it out.
I'm not sure why you aren't seeing it; besides a lack of imagination on my part, or blindness to something about my own env, I have to assume you aren't serving files with apache, or otherwise are overriding the .htaccess file.
Here's what I'm seeing:
the comments-react.js uses /api/v1/comments/
as a base path
Laravel ships with a /public/.htaccess file with a rewrite rule that removes trailing slashes from non-folder paths
so the store and index actions are getting 301'ed to /api/v1/comments
(note missing trailing slash)
That's fine for the index call, but it breaks the store call, because when you 301 a POST, it is converted into a GET and the data is lost.
when I remove that trailing slash in comments-react.js, everything works great.
from comments.
I see. I have created a new release 1.1.1 where I removed the trailing slash and modified the URL string for delete and update. Let me know if it works for you.
It still works for me on Nginx, maybe it will work for you too on Apache.
Remember to publish the latest assets once you upgrade the package:
php artisan vendor:publish --provider="Laravelista\Comments\Providers\CommentsServiceProvider" --tag=public --force
from comments.
great! will try today
from comments.
I have the same problem... @agouticreative Did you solve the problem? When I visit the page, I point out that I am not login...
There are no comments yet. Be the first to comment. You must login to post a comment.
from comments.
if i have comments on the model i see this message (There are no comments yet. Be the first to comment. You must login to post a comment.) even i signed in
from comments.
even the problem still persist on latest laravel build
from comments.
same problem on laravel 5.5 even on fresh install !
what can we do to help you fix it ?
from comments.
As soon as I find some time I will fix this issue and all others. I have a solution ready, just need to sit down and code it.
from comments.
Great news, thanks for taking time to fix it 🥇 :) @mabasic
from comments.
I have the same issue here, only that I get 404 error.
http://dev.local.com/api/v1/comments?content_type=App%5CProjectWeek&content_id=9
Status Code: 404 Not Found
Laravel 5.5
Did you manage to publish a fix? Or I will have to abound this package. Maybe tell us what is the problem so we can code ourselves a temporary fix.
from comments.
I got the same issue today end June 2018...thanks to the creator for this lib but you should specify on the main page that the library is broken. I spend 3h to fight with this issue before discovering it was a well known issue.
You should avoid new people to install your library and potentially running again in some time lost
Thanks
from comments.
I tell you what... I am fixing this this weekend.
from comments.
@mabasic , thank you , my meaning was your library has some potential, maybe you could let other contributors support you to improve it...for now we cant as your native files are not all published, especially react files
from comments.
Fixed in version 2.0.0
from comments.
Thanks @mabasic ,
Will see if some other users have the same issue but seems v2.0.0 throw
CommentServiceProvider not found
Script php artisan package:discover handling the post autoload dump event returned with error code 1
during Composer require command launched for update of package.
from comments.
You need to remove CommentServiceProvider from app.php.
This new version uses package discovery to register the service provider.
from comments.
Related Issues (20)
- Call count on Null HOT 3
- On server not Working.. HOT 2
- Changes not detected in Blade File HOT 4
- Error installing for Laravel 7 HOT 1
- Latest Release Tag? HOT 1
- Argument 2 passed to Laravelista\Comments\CommentPolicy::reply() must be an instance of Laravelista\Comments\Comment HOT 1
- The edit/replay button not working
- Laravel 9.x Compatibility HOT 1
- ajax support HOT 1
- Reply for Guest Users HOT 1
- Spatie permission issues after upgrading to Laravel 9 HOT 2
- unable to install in laravel 9 HOT 7
- Loading all comments? HOT 1
- Call to a member function count() on null HOT 3
- Attempt to read property "comments" on string
- Section added after the comment block is not working -
- markdown styling is not working
- Laravel 9 doesn't support HOT 1
- Abandoned HOT 1
- Not compatible with Laravel 10.X , unable to install 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 comments.