'Feather icons not showing
I would like to use feather-icons in Asp.net Core cshtml files. I followed their github steps but it won't show as it is stated in the docs:
<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link" asp-controller="Home">
<i data-feather="home"></i>
Home
</a>
</li>
</ul>
_Layout
<script src="~/lib/feather-icons/dist/feather.js"></script>
Solution 1:[1]
You have to provide http method type and a valid csdrf field. Example assuming your route is defined as 'put' in your api.php/admin.php file.
<form method="POST" action="{{ route('your-route-name') }}" enctype="multipart/form-data">
{{ csrf_field() }}
{{ method_field('PUT')}}
Alternatively, you can use the newer laravel convention
<form action="/foo/bar" method="POST">
@method('PUT')
...
</form>
More at the docs: Method field
By the way, try not to use blade form directives such as Form::open, they are mostly deprecated AFAIK.
Solution 2:[2]
If you use ResourceController, you can use this.
<form action="{{ route('enter code here') }}" method="POST">
@csrf
@method('PUT')
If you use Controller (simple), you can use this.
<form action="{{ route('enter code here') }}" method="POST">
@csrf
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | |
| Solution 2 | Taleh Orucov |
