Skip to content

Commit

Permalink
Updating the package
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanedev-maroc committed Dec 20, 2016
1 parent a425c16 commit c9c9307
Show file tree
Hide file tree
Showing 8 changed files with 124 additions and 35 deletions.
10 changes: 10 additions & 0 deletions config/sidebar/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,15 @@
//
],
],
[
'title' => 'Settings',
'name' => 'tracker-settings',
'route' => 'admin::tracker.settings.index',
'icon' => 'fa fa-fw fa-cogs',
'roles' => [Role::ADMINISTRATOR],
'permissions' => [
//
],
],
],
];
5 changes: 3 additions & 2 deletions config/tracker.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,11 @@
'routes' => [
'ignore' => [
'names' => [
// route names like 'blog.*'
// Route names like 'blog.*'
'admin::*',
],
'uris' => [
'dashboard', 'dashboard/*'
// URIs like 'dashboard/*'
],
],

Expand Down
15 changes: 15 additions & 0 deletions resources/lang/en/trackers.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
//

return [
'cookies' => 'Cookies',
'devices' => 'Devices',
'errors' => 'Errors',
'geoip' => 'Geoip',
'languages' => 'Languages',
'paths' => 'Paths',
'path-queries' => 'Path queries',
'referers' => 'Referers',
'users' => 'Users',
'user-agents' => 'User agents',
];
15 changes: 15 additions & 0 deletions resources/lang/fr/trackers.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
//

return [
'cookies' => 'Cookies',
'devices' => 'Appareils',
'errors' => 'Erreurs',
'geoip' => 'Géolocalisation des IP',
'languages' => 'Langues',
'paths' => 'Chemins',
'path-queries' => 'Requêtes de chemin',
'referers' => 'Référents',
'users' => 'Utilisateurs',
'user-agents' => 'Agents utilisateurs',
];
35 changes: 35 additions & 0 deletions resources/views/admin/settings/index.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@section('header')
<h1>Tracker <small>Settings</small></h1>
@endsection

@section('content')
<div class="row">
<div class="col-md-4">
<div class="box">
<div class="box-header with-border">
<h2 class="box-title">Trackers</h2>
</div>
<div class="box-body no-padding">
<div class="table-responsive">
<table class="table table-condensed table-hover no-margin">
<tbody>
@foreach ($trackers as $key => $status)
<tr>
<td>
<b>{{ trans("tracker::trackers.$key") }}</b>
</td>
<td class="text-right">
<span class="label label-{{ $status ? 'success' : 'danger' }}">
<i class="fa fa-fw fa-{{ $status ? 'check' : 'times' }}"></i>
</span>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
@endsection
42 changes: 42 additions & 0 deletions src/Http/Controllers/Admin/SettingsController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php namespace Arcanesoft\Tracker\Http\Controllers\Admin;

use Illuminate\Support\Arr;

/**
* Class SettingsController
*
* @package Arcanesoft\Tracker\Http\Controllers\Admin
* @author ARCANEDEV <arcanedev.maroc@gmail.com>
*/
class SettingsController extends Controller
{
/* ------------------------------------------------------------------------------------------------
| Constructor
| ------------------------------------------------------------------------------------------------
*/
/**
* SettingsController constructor.
*/
public function __construct()
{
parent::__construct();

$this->addBreadcrumbRoute('Settings', 'admin::tracker.settings.index');
$this->setCurrentPage('tracker-settings');
}

/* ------------------------------------------------------------------------------------------------
| Main Functions
| ------------------------------------------------------------------------------------------------
*/
public function index()
{
$this->setTitle('Settings - Tracker');

$configs = config('arcanesoft.tracker', []);

return $this->view('admin.settings.index', [
'trackers' => Arr::get($configs, 'tracking', []),
]);
}
}
4 changes: 4 additions & 0 deletions src/Http/Routes/Admin/TrackerRoutes.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,9 @@ public function map(Registrar $router)
$this->group(['prefix' => 'visits', 'as' => 'visits.'], function () {
$this->get('/', 'VisitsController@index')->name('index'); // admin::tracker.visits.index
});

$this->group(['prefix' => 'settings', 'as' => 'settings.'], function () {
$this->get('/', 'SettingsController@index')->name('index'); // admin::tracker.settings.index
});
}
}
33 changes: 0 additions & 33 deletions src/Http/Routes/TrackerRoutes.php

This file was deleted.

0 comments on commit c9c9307

Please sign in to comment.