merge develop
This commit is contained in:
commit
bd7d44c1db
4 changed files with 57 additions and 32 deletions
|
|
@ -16,11 +16,8 @@ class HomeController extends Controller
|
|||
/**
|
||||
* Get only duty hours for today or later.
|
||||
* @var \Illuminate\Database\Eloquent\Builder $dutyhour
|
||||
*/
|
||||
$dutyhour = Dutyhour::where('date', '>', now()->modify('-1 day'))->orderBy('date', 'asc');
|
||||
|
||||
$dutyhourModels = $dutyhour->paginate(10);
|
||||
|
||||
*/
|
||||
$dutyhourModels = Dutyhour::where('date', '>', now()->modify('-1 day'))->orderBy('date', 'asc')->limit(10)->get();
|
||||
return view('home', compact('dutyhourModels'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,4 +19,34 @@ class InformationController extends Controller
|
|||
* @var string
|
||||
*/
|
||||
public static $layout = 'layout.app';
|
||||
|
||||
/**
|
||||
* After store model middleware
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function storedModel()
|
||||
{
|
||||
cache()->put('infos', Information::all(), 3600);
|
||||
}
|
||||
|
||||
/**
|
||||
* After update model middleware
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function updatedModel()
|
||||
{
|
||||
cache()->put('infos', Information::all(), 3600);
|
||||
}
|
||||
|
||||
/**
|
||||
* After delete model middleware
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function deletedModel()
|
||||
{
|
||||
cache()->put('infos', Information::all(), 3600);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,16 +28,16 @@ class AppServiceProvider extends ServiceProvider
|
|||
// * LOCAL FORCE eg: for Carbon
|
||||
// * Remove numeric to prevent float seperator to breaking numeric transactions
|
||||
\collect([\LC_TIME, \LC_MESSAGES, \LC_COLLATE, \LC_CTYPE, \LC_MONETARY])
|
||||
->map(function ($contant) {
|
||||
setlocale(
|
||||
$contant,
|
||||
\sprintf(
|
||||
'%s_%s.UTF-8',
|
||||
config('app.locale'),
|
||||
\strtoupper(config('app.locale'))
|
||||
)
|
||||
);
|
||||
});
|
||||
->map(function ($contant) {
|
||||
setlocale(
|
||||
$contant,
|
||||
\sprintf(
|
||||
'%s_%s.UTF-8',
|
||||
config('app.locale'),
|
||||
\strtoupper(config('app.locale'))
|
||||
)
|
||||
);
|
||||
});
|
||||
Carbon::setLocale(config('app.locale'));
|
||||
|
||||
// * Force bootstrap paginator
|
||||
|
|
@ -52,18 +52,21 @@ class AppServiceProvider extends ServiceProvider
|
|||
});
|
||||
|
||||
if (!app()->runningInConsole()) {
|
||||
$appInfos = Cache::remember('composer', 360, function () {
|
||||
$appInfos = Cache::remember('composer', 3600, function () {
|
||||
return json_decode(File::get(\app_path('../composer.json')));
|
||||
});
|
||||
View::share('name', $appInfos->name);
|
||||
View::share('version', $appInfos->version);
|
||||
View::share('license', $appInfos->license);
|
||||
View::share('informations', Information::all());
|
||||
|
||||
// * Groups
|
||||
View::share('markerLabels', Cache::rememberForever('markerLabels', function () {
|
||||
return Marker::getCachedLabels() ?? [];
|
||||
}));
|
||||
}//end if
|
||||
// * Informations
|
||||
$infos = Cache::remember('infos', 3600, function () {
|
||||
return Information::all();
|
||||
});
|
||||
View::share('informations', $infos);
|
||||
} //end if
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,11 +2,6 @@
|
|||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h1>Bienvenue sur le support LDC WEB.</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-4">
|
||||
<div class="col mb-5">
|
||||
<a href="{{ route('ticket.create') }}" class="btn btn-primary">
|
||||
|
|
@ -34,13 +29,13 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
@if($dutyhourModels->count())
|
||||
@foreach ($dutyhourModels as $dutyhourModel)
|
||||
<tr>
|
||||
<td class="align-middle">{{ $dutyhourModel->date->formatLocalized('%d/%m/%Y') }}</td>
|
||||
<td class="align-middle">{{ $dutyhourModel->person }}</td>
|
||||
<td class="align-middle">{{ $dutyhourModel->place }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@foreach ($dutyhourModels as $dutyhourModel)
|
||||
<tr>
|
||||
<td class="align-middle">{{ $dutyhourModel->date->formatLocalized('%d/%m/%Y') }}</td>
|
||||
<td class="align-middle">{{ $dutyhourModel->person }}</td>
|
||||
<td class="align-middle">{{ $dutyhourModel->place }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
<tr>
|
||||
<td colspan="5" class="text-center">
|
||||
|
|
@ -54,4 +49,4 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@endsection
|
||||
Loading…
Add table
Reference in a new issue