Laravel submitting form as GET but coded as POST - laravel

I've just created a form with blade and for some reason its posting with GET even though the HTML says POST and to a different URL (see gif http://cl.ly/image/381k1j0t3x3c )
Routes:
http://cl.ly/image/101V1g2l2X1K
Controler:
http://cl.ly/image/1P2b0O0u3U0q
Blade File:
http://cl.ly/image/2m3B0g3g1T1S
Has anyone had this issue before, anyone see something dumb I've missed?

In your view, remove <form role='form'> tag. Don't wrap form with another form
{{ Form::open(['action'=>'CategoryController#adminStoreCategory']) }}
....
{{ Form::close() }}

Related

Vue links are formatted weirdly

I am new to Vue js, Inertia and Laravel.
But I have gotten stuck and cannot figure out what the problem is even though I try searching google and looking at videos.
I have this code
<div v-for="(seed, index) in seeds" :key="index">
Id {{ seed.id }}
<inertia-link :href="'/fert/' + '{{ seed.id }}'">
Go to seed
</inertia-link>
</div>
And The first {{ seed.id }} outside of the links looks great, it shows the actual id.
However then {{ seed.id }} within the link formats, so the link shows this:
Id 1Go to seed
Why is it formatting inside the link but not outside? and how to I fix it?
Thanks in advance, and yes I am very noob. sorry
You shouldn't use curly braces in attribute's value.
Using :[attribute-name] already tells Vue that you gonna use some JS expressions in value
:href="'/fert/' + seed.id"
You shouldn't use curly braces within the link. A nicer way to concatenate vars with text is to use template literal ES6 with backticks
<inertia-link :href="`/fert/${seed.id}`">Go to seed</inertia-link>

How to show quileditor's content with blade

Normally, v-html in vue would solve this issue, I dont know how to get around it using blade. Note, if i use the mustache syntax it would show the contents with the tags and thats not okay.. Please any help is appreciated
You need to use {!! !!} instead of {{ }}
{!! $content !!}
https://laravel.com/docs/8.x/blade#displaying-unescaped-data

how to ignore iframe on blade Laravel

#Asking
Help me for my problem, when i built a website with Laravel
i am render my post with syntax like this :
<div>
<p>{!! $post->content !!}</p>
</div>
but i have problem, when i insert a i frame inside post, because the html has been removed with {!! !!}.
i have to try use {{ $post->content }}, but all content rendered with HTML
Any solution to this problem? ?
Thanks very much
With {!! you paste content "as is", in other words you become vulnerable to all types of issues like allowing <script> tags to be placed into your templates.
The {{ syntax will escape any HTML thus what you see is the actual html characters without actually parsing it (i.e. doing {{ '<b>bold</b>' }} will not result in a bold font but in the text <b>bold</b>).
Now with your problem: there are some cumbersome ways to filter out any html tags yourself and leave the <iframe>'s in there (something like {!! only_iframe($content) !!}), but it is quite difficult and will likely not result in a safe solution.
Your own answer which stated that you used {!!html_entity_decode($post->content)!!} simply means that your HTML was encoded to start with, which is not something I can deduct from your question. Note that you are now vulnerable to malicious code injection if you are not certain you can control the contents of $post->content.

Form::password in Laravel Blade Templates

I was trying to create a password field in the form in Laravel Blade templates but the output doesn't let me enter anything and it's not showing any placeholder either. The code doesn't cause any error.
Form:
{{ Form::open(array('class'=> 'forming')) }}
{{ Form::text('username','Username',array('class' => 'insi')); }}<br>
{{ Form::password('password',array('placeholder'=>'Password','class' => 'insi')); }}
{{ Form::close() }}
and the output is like that. Any help?
Second Input form is for password.
We are not seeing your generated HTML, but usually those problems are related to your HTML. For instance, you are using a CSS class 'insi', which may not letting you see the password characters.
To do a test remove/disable your CSS files from your main HTML and it probably will work fine.

Laravel Blade Highlight Change Tags

I am going to use AngularJS along with Laravel, and I wanted to change Laravel tags to [[ ]] (which I think BTW is nicer since [ ] looks more like blade and is sharper :p )
Anyhow, I changed it with
Blade::setContentTags('[[', ']]'); // for variables and all things Blade
Blade::setEscapedContentTags('[[[', ']]]'); // for escaped data
How do I change the "Bracket Highlight" in Sublime now so that it still highlights my new tags??
Not directly answerting your question, but my solution to have Angular and Blade playing nice is very simple, I create a _partial every time I need some Angular and name this partial just '.php' and not '.blade.php', so if I have a form that uses Angular, I have:
{{ Form::open() }}
#include('_partials.posts.forms.create');
{{ Form::close() }}
In this case the included file would be views/_partials/posts/forms/create.php.
About Sublime, download Blade Syntax Highlighter, this file might give you a clue about how to change that for you:
https://github.com/Medalink/laravel-blade/blob/master/laravel-blade.tmLanguage

Resources