Skip to content

Commit c0f71f1

Browse files
Removing link_to_route helper
1 parent 035510b commit c0f71f1

File tree

19 files changed

+139
-32
lines changed

19 files changed

+139
-32
lines changed

resources/views/admin/comments/_form.blade.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@
3030
</div>
3131

3232
<div class="pull-left">
33-
{{ link_to_route('admin.comments.index', __('forms.actions.back'), [], ['class' => 'btn btn-secondary']) }}
33+
<a href="{{ route('admin.comments.index') }}" class="btn btn-secondary">
34+
@lang('forms.actions.back')
35+
</a>
36+
3437
{!! Form::submit(__('forms.actions.update'), ['class' => 'btn btn-primary']) !!}
3538
</div>
3639

resources/views/admin/comments/_list.blade.php

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,21 @@
1212
<tbody>
1313
@foreach($comments as $comment)
1414
<tr>
15-
<td>{{ link_to_route('admin.comments.edit', Str::limit($comment->content, 50), $comment) }}</td>
16-
<td>{{ link_to_route('admin.posts.edit', $comment->post->title, $comment->post) }}</td>
17-
<td>{{ link_to_route('admin.users.edit', $comment->author->fullname, $comment->author) }}</td>
15+
<td>
16+
<a href="{{ route('admin.comments.edit', $comment) }}">
17+
{{ Str::limit($comment->content, 50) }}
18+
</a>
19+
</td>
20+
<td>
21+
<a href="{{ route('admin.posts.edit', $comment->post) }}">
22+
{{ $comment->post->title }}
23+
</a>
24+
</td>
25+
<td>
26+
<a href="{{ route('admin.users.edit', $comment->author) }}">
27+
{{ $comment->author->fullname }}
28+
</a>
29+
</td>
1830
<td>{{ humanize_date($comment->posted_at, 'd/m/Y H:i:s') }}</td>
1931
<td>
2032
<a href="{{ route('admin.comments.edit', $comment) }}" class="btn btn-primary btn-sm">
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
@extends('admin.layouts.app')
22

33
@section('content')
4-
<p>@lang('posts.show') : {{ link_to_route('posts.show', route('posts.show', $comment->post), $comment->post) }}</p>
4+
<p>
5+
@lang('posts.show') :
6+
<a href="{{ route('posts.show', $comment->post) }}">
7+
{{ route('posts.show', $comment->post) }}
8+
</a>
9+
</p>
10+
511
@include('admin/comments/_form')
612
@endsection

resources/views/admin/media/create.blade.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@
2323
</div>
2424

2525

26-
{{ link_to_route('admin.media.index', __('forms.actions.back'), [], ['class' => 'btn btn-secondary']) }}
26+
<a href="{{ route('admin.media.index') }}" class="btn btn-secondary">
27+
@lang('forms.actions.back')
28+
</a>
29+
2730
{!! Form::submit(__('forms.actions.save'), ['class' => 'btn btn-primary']) !!}
2831
{!! Form::close() !!}
2932
@endsection

resources/views/admin/posts/_list.blade.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,16 @@
1313
<tbody>
1414
@foreach($posts as $post)
1515
<tr>
16-
<td>{{ link_to_route('admin.posts.edit', $post->title, $post) }}</td>
17-
<td>{{ link_to_route('admin.users.edit', $post->author->fullname, $post->author) }}</td>
16+
<td>
17+
<a href="{{ route('admin.posts.edit', $post) }}">
18+
{{ $post->title }}
19+
</a>
20+
</td>
21+
<td>
22+
<a href="{{ route('admin.users.edit', $post->author) }}">
23+
{{ $post->author->fullname }}
24+
</a>
25+
</td>
1826
<td>{{ humanize_date($post->posted_at, 'd/m/Y H:i:s') }}</td>
1927
<td><span class="badge badge-pill badge-secondary">{{ $post->comments_count }}</span></td>
2028
<td><span class="badge badge-pill badge-secondary">{{ $post->likes_count }}</span></td>

resources/views/admin/posts/create.blade.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
{!! Form::open(['route' => ['admin.posts.store'], 'method' =>'POST']) !!}
77
@include('admin/posts/_form')
88

9-
{{ link_to_route('admin.posts.index', __('forms.actions.back'), [], ['class' => 'btn btn-secondary']) }}
9+
<a href="{{ route('admin.posts.index') }}" class="btn btn-secondary">
10+
@lang('forms.actions.back')
11+
</a>
12+
1013
{!! Form::submit(__('forms.actions.save'), ['class' => 'btn btn-primary']) !!}
1114
{!! Form::close() !!}
1215
@endsection

resources/views/admin/posts/edit.blade.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
11
@extends('admin.layouts.app')
22

33
@section('content')
4-
<p>@lang('posts.show') : {{ link_to_route('posts.show', route('posts.show', $post), $post) }}</p>
4+
<p>
5+
@lang('posts.show') :
6+
7+
<a href="{{ route('posts.show', $post) }}">
8+
{{ route('posts.show', $post) }}
9+
</a>
10+
</p>
511

612
@include('admin/posts/_thumbnail')
713

814
{!! Form::model($post, ['route' => ['admin.posts.update', $post], 'method' =>'PUT']) !!}
915
@include('admin/posts/_form')
1016

1117
<div class="pull-left">
12-
{{ link_to_route('admin.posts.index', __('forms.actions.back'), [], ['class' => 'btn btn-secondary']) }}
18+
<a href="{{ route('admin.posts.index') }}" class="btn btn-secondary">
19+
@lang('forms.actions.back')
20+
</a>
21+
1322
{!! Form::submit(__('forms.actions.update'), ['class' => 'btn btn-primary']) !!}
1423
</div>
1524
{!! Form::close() !!}

resources/views/admin/shared/navbar.blade.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<nav class="navbar navbar-dark bg-dark fixed-top navbar-expand-lg">
22
<div class="container">
33
<!-- Branding Image -->
4-
{{ link_to_route('home', config('app.name', 'Laravel'), [], ['class' => 'navbar-brand']) }}
4+
<a href="{{ route('home') }}" class="navbar-brand">
5+
{{ config('app.name', 'Laravel') }}
6+
</a>
57

68
<!-- Collapsed Hamburger -->
79
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
@@ -18,8 +20,13 @@
1820
</a>
1921

2022
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
21-
{{ link_to_route('users.show', __('users.public_profile'), Auth::user(), ['class' => 'dropdown-item']) }}
22-
{{ link_to_route('users.edit', __('users.settings'), [], ['class' => 'dropdown-item']) }}
23+
<a href="{{ route('users.show', Auth::user()) }}" class="dropdown-item">
24+
@lang('users.public_profile')
25+
</a>
26+
27+
<a href="{{ route('users.edit') }}" class="dropdown-item">
28+
@lang('users.settings')
29+
</a>
2330

2431
<div class="dropdown-divider"></div>
2532

resources/views/admin/users/_form.blade.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@
5757
@endforeach
5858
</div>
5959

60-
{{ link_to_route('admin.users.index', __('forms.actions.back'), [], ['class' => 'btn btn-secondary']) }}
60+
<a href="{{ route('admin.users.index') }}" class="btn btn-secondary">
61+
@lang('forms.actions.back')
62+
</a>
63+
6164
{!! Form::submit(__('forms.actions.update'), ['class' => 'btn btn-primary']) !!}
6265

6366
{!! Form::close() !!}

resources/views/admin/users/_list.blade.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
<tbody>
1212
@foreach($users as $user)
1313
<tr>
14-
<td>{{ link_to_route('admin.users.edit', $user->fullname, $user) }}</td>
14+
<td>
15+
<a href="{{ route('admin.users.edit', $user) }}">
16+
{{ $user->fullname }}
17+
</a>
18+
</td>
1519
<td>{{ $user->email }}</td>
1620
<td>{{ humanize_date($user->registered_at, 'd/m/Y H:i:s') }}</td>
1721
<td>

0 commit comments

Comments
 (0)