File tree Expand file tree Collapse file tree 6 files changed +57
-19
lines changed Expand file tree Collapse file tree 6 files changed +57
-19
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace TeachMe \Http \ViewComposers ;
4+
5+ use Illuminate \Support \Facades \Lang ;
6+ use Illuminate \Support \Facades \Route ;
7+
8+ class TicketsListComposer {
9+
10+ public function compose ($ view )
11+ {
12+ $ view ->title = trans (Route::currentRouteName () . '_title ' );
13+ $ view ->text_total = Lang::choice (
14+ 'tickets.total ' ,
15+ $ view ->tickets ->total (),
16+ ['title ' => strtolower ($ view ->title )]
17+ );
18+ }
19+
20+ }
Original file line number Diff line number Diff line change 1+ <?php namespace TeachMe \Providers ;
2+
3+ use Illuminate \Support \ServiceProvider ;
4+
5+ class ViewServiceProvider extends ServiceProvider {
6+
7+ /**
8+ * Bootstrap the application services.
9+ *
10+ * @return void
11+ */
12+ public function boot ()
13+ {
14+ view ()->composer (
15+ 'tickets/list ' ,
16+ 'TeachMe\Http\ViewComposers\TicketsListComposer '
17+ );
18+ }
19+
20+ /**
21+ * Register the application services.
22+ *
23+ * @return void
24+ */
25+ public function register ()
26+ {
27+ //
28+ }
29+
30+ }
Original file line number Diff line number Diff line change 150150 'TeachMe\Providers\EventServiceProvider ' ,
151151 'TeachMe\Providers\RouteServiceProvider ' ,
152152 'TeachMe\Providers\HtmlServiceProvider ' ,
153+ 'TeachMe\Providers\ViewServiceProvider ' ,
153154
154155 ],
155156
Original file line number Diff line number Diff line change 77 'closed_title ' => 'Tutoriales ' ,
88 'popular_title ' => 'Solicitudes populares ' ,
99
10- 'latest_total ' => '{0} No hay solicitudes recientes '
11- . '|{1} Sólo hay una solicitud reciente '
12- . '|[2,Inf] Hay :count solicitudes recientes ' ,
13-
14- 'open_total ' => '{0} No hay solicitudes abiertas '
15- . '|{1} Sólo hay una solicitud abierta '
16- . '|[2,Inf] Hay :count solicitudes abiertas ' ,
17-
18- 'closed_total ' => '{0} No hay tutoriales '
19- . '|{1} Sólo hay un tutorial '
20- . '|[2,Inf] Hay :count tutoriales ' ,
21-
22- 'popular_total ' => '{0} No hay solicitudes populares '
23- . '|{1} Sólo hay una solicitud popular '
24- . '|[2,Inf] Hay :count solicitudes populares ' ,
10+ 'total ' => '{0} No hay :title '
11+ . '|{1} Sólo hay una :title '
12+ . '|[2,Inf] Hay :count :title ' ,
2513
2614 'status ' => array (
2715 'open ' => 'Abierta ' ,
Original file line number Diff line number Diff line change 1-
21<!DOCTYPE html>
32<html lang =" en" >
43<head >
3433 <span class =" icon-bar" ></span >
3534 <span class =" icon-bar" ></span >
3635 </button >
37- <a class =" navbar-brand" href =" http ://duilio.me " target =" _blank" >duilio.me </a >
36+ <a class =" navbar-brand" href =" https ://styde.net " target =" _blank" >Styde.net </a >
3837 </div >
3938
4039 <div class =" collapse navbar-collapse" id =" bs-example-navbar-collapse-1" >
Original file line number Diff line number Diff line change 77 <div class =" col-md-10 col-md-offset-1" >
88 <div class =" row" >
99 <h1 >
10- {{ $title = trans (Route :: currentRouteName () . ' _title ' ) } }
10+ {{ $title } }
1111 <a href =" {{ route (' tickets.create' ) } }" class =" btn btn-primary" >
1212 Nueva solicitud
1313 </a >
1414 </h1 >
1515
1616 <p class =" label label-info news" >
17- {{ Lang :: choice (Route :: currentRouteName () . ' _total ' , $tickets -> total ()) } }
17+ {{ $text_total } }
1818 </p >
1919
2020 @foreach ($tickets as $ticket )
You can’t perform that action at this time.
0 commit comments