Комментарии:
k very usefull tutorial but how about just need to link two different sites like wordpress and prestashop whit laravell ?
ОтветитьI had a question about adding scripts and php code into the blog body area. It looks like you can only add certain html tags, like <p>, <h2> and a few more in the source code. Even if you add, images when you go to edit and save those elements disappear. Is it a CKeditor problem or a database filter problem? Any fix for this?
ОтветитьI want edit button I have edit.blade.php and index.blade.php but when I clicked on Edit I get 404
NOT FOUND. Please someone do not know what with it ?
Hey, how do I put it using regular forms?
Ответитьhi guys ,,any body can help i am getting error ErrorException
Trying to get property 'title' of non-object (View: C:\Users\DELL\xampp\htdocs\example-app\resources\views\pages\show.blade.php)
Now in Laravel 8 we do not need to use the hidden method for put & delete we can use it directly
Ответитьwhen i do php artisan route:list i get this 'Target class [PostsController] does not exist.'
ОтветитьHow can I avoid "PostsControllers@store\PostsController@destroy not defined" without having to explicitly type the full path to the controller in "action" every time?
ОтветитьGreat video, thanks.
ОтветитьIf I have a radio button input, how should I write the code to check the current value? For example, if it's a gender radio input and the current post is male and I want it to be checked while editing the post.
Ответитьhello guys, anyone have an idea why this happens?
after i edit the post. i look on the database and i have <p> tag on the edited body post that i did.
it look like this in the database:
id: 2
title: Post Two
body: <p>This is post <strong><em>two</em></strong>
created_at
updated_at
please help me with this.
Thank you my friend!
ОтветитьDoes CKeditor work in laravel 7.9. I tried several times installing with no luck
ОтветитьHey 2020(under ecq) guys, 'PostsController@update'
Ответитьexcellent work
ОтветитьProblems i encountered:
1.I couldn't set the TextArea value.
2.After I click edit an error popped up:
"The POST method is not supported for this route. Supported methods: GET, HEAD, PUT, PATCH, DELETE."
Solution:
<form action="{{ route('posts.update', $post->id) }}" method="POST">
<div class="form-group">
<label for="Title">Title</label>
<input type="text" class="form-control" name="title" value="{{$post->title}}" placeholder="Title">
</div>
<div class="form-group">
<label for="Body">Body</label>
<textarea class="form-control" name="body" value="jjjj" rows="3" placeholder="Body text">
{{-- Problem 1 Solution-start --}}
{!!$post->body!!}
{{-- Problem 1 Solution-end --}}
</textarea>
</div>
<div class="form-group">
{{-- Problem 2 Solution-start --}}
<input type="hidden" name="_method" value="PUT">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
{{-- Problem 2 Solution-end --}}
<input type="submit" value="Submit" class="btn-outline-secondary btn ">
</div>
</form>
any one can solve this problum ??
htmlspecialchars() expects parameter 1 to be string, array given (View: C:\xampp1\htdocs\lsappc\resources\views\posts\edit.blade.php)
for some reason when i add that delete form to the show page it breaks the app, i'm getting a 500 error back.
Ответитьif you are getting The POST method is not supported for this route. Supported methods: GET, HEAD, PUT, PATCH, DELETE. then all you can do is
{!!Form::hidden('_method','PUT')!!}
use this instead of
{{Form::hidden('_method','PUT')}}
.
the first one works well
In laravel 6 Laravel Collective, you can directly use
{!! Form::open(['method' => 'PUT', 'action' => ['PostsController@update', $post->id] ]) !!}
PUT and DELETE methods will now be spoofed automatically
Hi, regarding the notification of deletion of the post - mine does not show the bootstrap success notification (the green box above) upon redirecting to "/posts"; although the post is successfully removed. Tried if the pagination affects it but it doesn't.
Ответитьu lost me at 'editor', i couldn't get that working, i tried to revert back to not use it but now as soon as i click on the text field in create post, it's submitting, i'll do it from scratch again
Ответитьbro how to update image
ОтветитьThanks man
Ответитьhi sir i like ur lectures
sir in CRUD i have one doubt
i face an error "undefined variable "id" while working with destroy method
i copied similar to ur lecture
pls reply for this
PUT/DELETE are now allowed as form methods in Laravel v6.4.1:
and the routes work fine this way also.
in edit.blade.php
{!! Form::open(['action' => ['PostsController@update', $post->id], 'method' => 'PUT']) !!}
in show.blade.php
{!! Form::open(['action' => ['PostsController@destroy', $post->id], 'method' => 'DELETE']) !!}
Is it necessary to use form helper in blade?
Can't we just write html for it?
anyone can help me about this
ОтветитьUndefined offset: 0 (View: /Applications/XAMPP/xamppfiles/htdocs/laravel/resources/views/posts/show.blade.php)
Ответитьi got this error 👆
ОтветитьVery helpful. Thank you. I've spent all morning looking for a way to do this!
ОтветитьStatus Code: 405 Method Not Allowed message: "The PUT method is not supported for this route. Supported methods: GET, HEAD, POST."
I kept getting this error so I removed the form hidden put but it worked just fine. Is this okay?
Have to say this is the best Laravel series there is. And I have tried 2 series earlier to this and just left them in the middle because they were either boring or way to fast, to my liking.
ОтветитьLoving course, however one problem. If i'm on create or edit page & choose to click 'BLOG' in navbar it cannot find the posts page. (Error:Trying to get property 'title' of non-object (View: C:\xampp\htdocs\lsapp\resources\views\posts\show.blade.php). Don't understand why its looking for show.blade.php. The link works fine when moving along navbar but not from in or creating a post. Would be very grateful if anybody could point me to my error, many thanks
Ответитьclean and simple as Laravel. Great tutorial. Thank you, Brad.
ОтветитьAnyone who gets '$post->title' and '$post->body' on the edit fields:
edit.blade.php
make sure to remove the ' ' on your $post->title and same goes to the body...
I'm soooo in love of this tutorial, amazing explanation Brad..thank u bro
Ответитьbtn-default actually not existed during my time of trying, I've check my css file (\lsapp\public\css\app.css), btn-default is not found
Ответитьin version 5.8
{{FORM::hidden('_method','xxxx')}} is no need to use anymore
if someone has problem with the form 'action' and it doesn't work, you should use 'url' instead of action.
ОтветитьRe posting this here from someone else lower on the comments, so that people can see it more easily. This piece of code should fix the problem when getting an error after editing a post.
<h1>Edit Post</h1>
{!! Form::open(['action' => ['PostsController@update', $post->id], 'method' => 'PUT']) !!}
<div class="form-group">
{{ Form::label('title', 'Title', ) }}
{{ Form::text('title', $post->title, ['class' => 'form-control', 'placeholder' => 'Title']) }}
</div>
<div class="form-group">
{{ Form::label('body', 'Body', ) }}
{{ Form::textarea('body', $post->body, ['class' => 'form-control', 'placeholder' => 'Body', 'id' => 'article-ckeditor', 'style' => 'resize:none;']) }}
</div>
{{ Form::submit('Submit', ['class' => 'btn btn-success']) }}
{!! Form::close() !!}
Undefined variable: post (View: C:\xampp\htdocs\lsapp\resources\views\posts\show.blade.php) get this after edit post
Ответитьi am using the destroy function to delete as in the video but it goes to store function when i press the delete button
ОтветитьThe code below works fine dont need to add that hidden form thng
<h1>Edit Post</h1>
{!! Form::open(['action' => ['PostsController@update', $post->id], 'method' => 'PUT']) !!}
<div class="form-group">
{{ Form::label('title', 'Title', ) }}
{{ Form::text('title', $post->title, ['class' => 'form-control', 'placeholder' => 'Title']) }}
</div>
<div class="form-group">
{{ Form::label('body', 'Body', ) }}
{{ Form::textarea('body', $post->body, ['class' => 'form-control', 'placeholder' => 'Body', 'id' => 'article-ckeditor', 'style' => 'resize:none;']) }}
</div>
{{ Form::submit('Submit', ['class' => 'btn btn-success']) }}
{!! Form::close() !!}
in post->id id is not taking , instead of id it is displaying only character id not showing number. what to do ???
Ответить