-2

ErrorException (E_ERROR) Use of undefined constant yonetim - assumed 'yonetim' (this will throw an Error in a future version of PHP) (View: /srv/http/blog/resources/views/admin/template.blade.php) (View: /srv/http/blog/resources/views/admin/template.blade.php) Previous exceptions

Use of undefined constant yonetim - assumed 'yonetim' (this will throw an Error in a future version of PHP) (View: /srv/http/blog/resources/views/admin/template.blade.php) (0) Use of undefined constant yonetim - assumed 'yonetim' (this will throw an Error in a future version of PHP) (0)

php

<ul>
    <li class="active"><a href="{{ route(yonetim.index) }}"><i class="icon icon-home"></i> <span>Dashboard</span></a> </li>
    <li class=""><a href="{{ route(ayarlar.index) }}"><i class="icon icon-home"></i> <span>Ayarlar</span></a> </li>
aynber
  • 22,380
  • 8
  • 50
  • 63
Ahmet Barut
  • 13
  • 1
  • 2
  • 1
    Possible duplicate of [Reference - What does this error mean in PHP?](https://stackoverflow.com/questions/12769982/reference-what-does-this-error-mean-in-php) – aynber Jun 11 '19 at 18:11
  • 1
    You need quotes around your route, inside the parenthesis – aynber Jun 11 '19 at 18:11
  • and if you try this: `route('yonetim.index')` –  Jun 11 '19 at 18:40

2 Answers2

1

Replace your <li> with this as you are missing quotes:

<li class="active"><a href="{{ route('yonetim.index') }}"><i class="icon icon-home"></i> <span>Dashboard</span></a> </li>
<li class=""><a href="{{ route('ayarlar.index') }}"><i class="icon icon-home"></i> <span>Ayarlar</span></a> </li>

Can also try:

Example route for below: Route::get('/home/index', 'HomeController@index');

<li class="active"><a href="{{ '/home/index' }}"><i class="icon icon-home"></i> <span>Dashboard</span></a> </li>
Jelly Bean
  • 1,161
  • 1
  • 11
  • 22
-1

Just replace your code with this,

<ul>
    <li class="active"><a href="{{ 'route(yonetim.index)' }}"><i class="icon icon-home"></i> <span>Dashboard</span></a> </li>
    <li class=""><a href="{{ 'route(ayarlar.index)' }}"><i class="icon icon-home"></i> <span>Ayarlar</span></a> </li>
gnat
  • 6,213
  • 108
  • 53
  • 73
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. If you [earn](//meta.stackoverflow.com/q/146472/169503) sufficient [reputation](//stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](//stackoverflow.com/help/privileges/comment). – Waqar UlHaq Feb 26 '20 at 11:07