PHP Classes
elePHPant
Icontem

Polr Admin Dashboard: Another admin dashboard for the Polr URL shortener

Recommend this page to a friend!
  Info   View files Documentation   View files View files (41)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2017-11-05 (15 days ago) RSS 2.0 feedNot enough user ratingsTotal: 67 This week: 1All time: 8,969 This week: 627Up
Version License PHP version Categories
polr-admin 0.0.7GNU General Publi...5PHP 5, Content management
Description Author

This package implements another admin dashboard for the Polr URL shortener.

The features are mostly the same as in the Polr Admin section, but with few differences.

- The link redirection feature is not included
- The dashboard is based on Laravel instead of Lumen
- AngularJS is dropped in favor of Jaxon
- A Confirm Password field is added to the Change Password form
- The URL shortening and link stats features are fully implemented with AJAX, using Jaxon

  Performance   Level  
Name: Thierry Feuzeu <contact>
Classes: 11 packages by
Country: Cameroon Cameroon
Age: 41
All time rank: 27203 in Cameroon Cameroon
Week rank: 116 Up1 in Cameroon Cameroon Up
Innovation award
Innovation award
Nominee: 1x

Details

Polr Admin

An alternative admin dashboard for the Polr URL shortener.

Our goal is to provide a dashboard with advanced features for managing multiple Polr instances.

This dashboard is packaged as a Laravel extension. Firstly, it makes the package simpler since there is no need to deal with user management features. Then, it lets the end user choose how to integrate: in an existing Laravel application, or in a third-party Laravel admin panel.

The Polr API package needs to be installed on each instance of Polr to be managed.

Features

The features are mostly the same as Polr, but with few differences.

  • The package is a Laravel extension, and not a standalone application.
  • AngularJS is dropped in favor of Jaxon https://www.jaxon-php.org.
  • The Settings tab allows to choose a Polr instance from a dropdown list.
  • The dashboard can display stats for all links.
  • All features are fully implemented with Ajax, using Jaxon.
  • The user creation and deletion, link redirection and password change features are not included.

Installation

Add the Github repository and package in the composer.json file, and run composer update.

{
    "repositories": [
        {
            "type": "git",
            "url": "https://github.com/lagdo/polr-admin"
        }
    ],
    "require": {
        "lagdo/polr-admin": "dev-master"
    }
}

Add Jaxon, Datatables and Polr Admin to the providers and aliases entries in app.php.

    'providers' => [
        // Jaxon Ajax library
        Jaxon\Laravel\JaxonServiceProvider::class,
        // Datatables
        Yajra\Datatables\DatatablesServiceProvider::class,
        // Polr Admin
        Lagdo\Polr\Admin\PolrAdminServiceProvider::class,
    ],

    'aliases' => [
        // Datatables
        'Datatables'   => Yajra\Datatables\Facades\Datatables::class,
    ],

Publish the public files.

php artisan vendor:publish --tag=public --force

Publish the config files.

php artisan vendor:publish --provider="Jaxon\Laravel\JaxonServiceProvider" --tag="config"
php artisan vendor:publish --provider="Lagdo\Polr\Admin\PolrAdminServiceProvider" --tag="config"

This will create the jaxon.php and polradmin.php files in the config dir.

Configuration

Edit the config/polradmin.php config file, and list the Polr intances.

return [
    'default' => 'first',
    'endpoints' => [
        'first' => [
            'name'       => 'First Instance', // The name of this instance for dropdown menu
            'url'        => 'http://polr.domain.com',
            'api'        => 'api/v2',
            'key'        => 'PolrApiKey', // The user API key on the Polr instance
        ],
    ],
];

Integration

The package provides various functions returning the HTML, Javascript and CSS codes to be inserted into a template.

First of all, let's consider the following Laravel controller, where the Jaxon and PolrAdmin objects are injected in the index() method and passed to a template.

use Jaxon\Laravel\Jaxon;
use Lagdo\Polr\Admin\PolrAdmin;

class PolrController extends Controller
{
    public function index(Jaxon $jaxon, PolrAdmin $polr)
    {
        // Register Jaxon classes
        $jaxon->register();

        return view('index', ['jaxon' => $jaxon, 'polr' => $polr]);
    }
}

The following calls will return the codes to be inserted in the template.

  • $jaxon->css(): The Jaxon CSS includes.
  • $jaxon->js(): The Jaxon Javascript includes.
  • $jaxon->script(): The Jaxon Javascript code.
  • $polr->css(): The Polr Admin CSS includes.
  • $polr->js(): The Polr Admin Javascript includes.
  • $polr->html(): The Polr Admin HTML code.
  • $polr->ready(): The Javascript code to run on page ready.

So a sample template will look like this.

@extends('layouts.base')

@section('css')
{!! $jaxon->css() !!}

{!! $polr->css() !!}
@endsection

@section('content')

{!! $polr->html() !!}

@endsection

@section('js')
{!! $jaxon->js() !!}
{!! $jaxon->script() !!}

{!! $polr->js() !!}

<script type="text/javascript">
$(document).ready(function() {
    {!! $polr->ready() !!}
});
</script>
@endsection
  Files folder image Files  
File Role Description
Files folder imageconfig (2 files)
Files folder imageresources (2 directories)
Files folder imagesrc (2 files, 1 directory)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  config  
File Role Description
  Accessible without login Plain text file jaxon.php Aux. Auxiliary script
  Accessible without login Plain text file polr.php Aux. Auxiliary script

  Files folder image Files  /  resources  
File Role Description
Files folder imageassets (2 directories)
Files folder imageviews (4 files, 4 directories)

  Files folder image Files  /  resources  /  assets  
File Role Description
Files folder imagecss (4 files)
Files folder imagejs (5 files)

  Files folder image Files  /  resources  /  assets  /  css  
File Role Description
  Accessible without login Plain text file admin.css Data Auxiliary data
  Accessible without login Plain text file base.css Data Auxiliary data
  Accessible without login Plain text file index.css Data Auxiliary data
  Accessible without login Plain text file stats.css Data Auxiliary data

  Files folder image Files  /  resources  /  assets  /  js  
File Role Description
  Accessible without login Plain text file base.js Data Auxiliary data
  Accessible without login Plain text file home.js Data Auxiliary data
  Accessible without login Plain text file jquery-jvectormap-world-mill.js Data Auxiliary data
  Accessible without login Plain text file jquery-jvectormap.min.js Data Auxiliary data
  Accessible without login Plain text file stats.js Data Auxiliary data

  Files folder image Files  /  resources  /  views  
File Role Description
Files folder imageshorten (1 file)
Files folder imagesnippets (6 files)
Files folder imagestats (2 files, 1 directory)
Files folder imagetabs (6 files)
  Accessible without login Plain text file css.blade.php Aux. Auxiliary script
  Accessible without login Plain text file default.blade.php Aux. Auxiliary script
  Accessible without login Plain text file js.blade.php Aux. Auxiliary script
  Accessible without login Plain text file polr.blade.php Aux. Auxiliary script

  Files folder image Files  /  resources  /  views  /  shorten  
File Role Description
  Accessible without login Plain text file result.blade.php Aux. Auxiliary script

  Files folder image Files  /  resources  /  views  /  snippets  
File Role Description
  Accessible without login Plain text file edit_long_url.blade.php Aux. Auxiliary script
  Accessible without login Plain text file edit_user_api_info.blade.php Aux. Auxiliary script
  Accessible without login Plain text file js.blade.php Aux. Auxiliary script
  Accessible without login Plain text file link_table.blade.php Aux. Auxiliary script
  Accessible without login Plain text file select-roles.blade.php Aux. Auxiliary script
  Accessible without login Plain text file user_table.blade.php Aux. Auxiliary script

  Files folder image Files  /  resources  /  views  /  stats  
File Role Description
Files folder imagelink (1 file)
  Accessible without login Plain text file content.blade.php Aux. Auxiliary script
  Accessible without login Plain text file content.blade.php Aux. Auxiliary script

  Files folder image Files  /  resources  /  views  /  tabs  
File Role Description
  Accessible without login Plain text file admin-links.blade.php Aux. Auxiliary script
  Accessible without login Plain text file home.blade.php Aux. Auxiliary script
  Accessible without login Plain text file settings.blade.php Aux. Auxiliary script
  Accessible without login Plain text file stats.blade.php Aux. Auxiliary script
  Accessible without login Plain text file user-links.blade.php Aux. Auxiliary script
  Accessible without login Plain text file users.blade.php Aux. Auxiliary script

  Files folder image Files  /  src  
File Role Description
Files folder imageAjax (2 directories)
  Accessible without login Plain text file PolrAdmin.php Class Class source
  Accessible without login Plain text file PolrAdminServiceProvider.php Class Class source

  Files folder image Files  /  src  /  Ajax  
File Role Description
Files folder imageClasses (3 files)
Files folder imagePlugins (1 directory)

  Files folder image Files  /  src  /  Ajax  /  Classes  
File Role Description
  Accessible without login Plain text file Link.php Class Class source
  Accessible without login Plain text file Stats.php Class Class source
  Accessible without login Plain text file User.php Class Class source

  Files folder image Files  /  src  /  Ajax  /  Plugins  
File Role Description
Files folder imageDatatables (2 files)

  Files folder image Files  /  src  /  Ajax  /  Plugins  /  Datatables  
File Role Description
  Accessible without login Plain text file Plugin.php Class Class source
  Accessible without login Plain text file Renderer.php Class Class source

Downloadpolr-admin-2017-11-05.zip 90KB
Downloadpolr-admin-2017-11-05.tar.gz
Install with ComposerInstall with Composer
Needed packages  
Class DownloadWhy it is needed Dependency
Jaxon Download .zip .tar.gz Uses the provided features Required
 Version Control Unique User Downloads Download Rankings  
 100%
Total:67
This week:1
All time:8,969
This week:627Up