Download the PHP package kontenta/kontour without Composer

On this page you can find all versions of the php package kontenta/kontour. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package kontour

Kontour

Run tests

Kontour is a package of admin page utilities for Laravel. It provides a shared "frame" for the admin tool routes you create in your Laravel apps, or in packages you install or create.

The idea is that your admin tools can pull in and use functionality from Kontour to provide a consistent experience for the whole admin area of a website. Your admin tools are built using standard Laravel routes, controllers, authentication, authorization, validation, views, etc. Kontour is there to provide enhancements and reusable elements for your admin area.

You need at least Laravel 9 to use the latest version of this package.

Using Kontour in a Laravel app

This document aims to provide instructions on how to configure Kontour in a Laravel app. Once configured you can log in to the Kontour admin area and use any admin tools from installed packages.

Creating admin tools using Kontour

For documentation how to create and register your own tools leveraging the features Kontour provides, you'll find the documentation and helpful guides in Using Kontour to build admin tools.

Features

Architecture

Install

Maybe you're here because some package you installed requires Kontour for its admin pages? In that case Kontour is already installed by composer, but you will still want to read further below about how to configure Kontour to your liking.

You are the owner of your Laravel app, even if Kontour was required by some other package, and you'll at least need to setup the admin user model before you can log in to the Kontour admin area.

Installing Kontour explicitly in your Laravel project:

If you don't want the Kontour service provider to run in your project you may opt out of package discovery.

Checking the route list

Kontour, and packages using it, will register routes automatically in your Laravel app. To keep track of what's happening you may print all the routes using artisan:

The list will display information about every URI, route name, and middleware in your app. Among others you'll find the kontour.login, kontour.logout, and kontour.index routes. If these routes are not to your liking there are configuration values you can set to change the url prefix or domain, or even turn them off completely.

Configure Kontour in your Laravel project

Publish the configuration with artisan:

Then you can edit config/kontour.php and uncomment any of the example settings you want to tweak.

Logging in

By default the Kontour dashboard route kontour.index is reached by going to /admin in your browser.

To enable login you need to make sure the user model you want to give access to the admin area implements the Kontenta\Kontour\Contracts\AdminUser contract which has a method getDisplayName() that should return... a display name!

The default Kontour configuration uses Laravel's web Guard from config/auth.php which in turn uses the Eloquent user provider with model App\User::class. If you're happy to let all your users into the admin area (i.e. you have no front end users) you can modify that user class to implement the interface, by having it extend Kontenta\Kontour\Auth\AdminUser.

This requirement is deliberate to avoid any situation where someone accidentally gives front end users access to their admin routes. You need to make an active choice about which user model to let into the admin area.

Creating a separate user provider for admins

The most common situation is that you want a separate table and model for admin users, and a separate Laravel User Provider and Guard to go with that.

  1. Create an Eloquent model and table. The simplest way is to make copies of Laravel's original app/User.php model and database/migrations/2014_10_12_000000_create_users_table.php migration and modify them to your needs.
  2. Make sure the model implements Kontenta\Kontour\Contracts\AdminUser, perhaps by extending Kontenta\Kontour\Auth\AdminUser.
  3. Edit config/auth.php to add a Guard, User Provider and perhaps a password reset configuration:

  4. Edit config/kontour.php and tell it to use the name of your admin guard, and the passwords configuration:

Creating admin users

It doesn't make sense to have a public registration for admin users so the easiest way to create admin users for development and production is through php artisan tinker:

If you're feeling adventurous, you can then create an admin tool within Kontour to let a logged in admin create and invite new admin users!

Publish the default CSS and js in your Laravel project

You probably want to add some style to your admin area, pure HTML with default browser styles is too brutalist for most people... A good place to start is the default Kontour stylesheet.

The included javascript includes a feature to confirm any delete-action before submitting those forms, and a confirmation before leaving a page with "dirty" form inputs.

Method A: artisan

Traditionally, publishing assets is done using artisan.

Publish CSS with artisan

Then edit config/kontour.php and uncomment 'css/kontour.css' in the stylesheets array to make every admin page pull in the stylesheet.

Publish js with artisan

Then edit config/kontour.php and uncomment 'js/kontour.js' in the javascripts array to make every admin page pull in the javascript.

Method B: Mix

It's also possible to use Laravel Mix to copy and version public assets.

In webpack.mix.js:

In config/kontour.php

Casting Mix's output to a string in the config file makes it possible to cache the config in a production environment.

Fallback implementations

This package contains implementations of the Kontour contracts that are used as a fallback whenever no other implementation has been registered in the Laravel service container.

Overriding implementations may be registered by service providers of other packages or your main application.


All versions of kontour with dependencies

PHP Build Version
Package Version
Requires laravel/framework Version ^9.0 || ^10.0
laravel/ui Version ^4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kontenta/kontour contains the following files

Loading the files please wait ....