GithubHelp home page GithubHelp logo

frozennode / laravel-administrator Goto Github PK

View Code? Open in Web Editor NEW
1.9K 122.0 506.0 7.4 MB

An administrative interface package for Laravel

Home Page: http://administrator.frozennode.com/

License: MIT License

PHP 43.26% CSS 9.42% JavaScript 24.90% HTML 22.30% Shell 0.13%

laravel-administrator's Introduction

Laravel Administrator

Project Abandoned

WARNING: This project is no longer being maintained.

Administrator is an administrative interface builder for Laravel. With Administrator you can visually manage your Eloquent models and their relations, and also create stand-alone settings pages for storing site data and performing site tasks.

Build Status

Composer

To install Administrator as a Composer package to be used with Laravel 5, simply run:

composer require "frozennode/administrator: 5.*"

Once it's installed, you can register the service provider in config/app.php in the providers array:

'providers' => [
	'Frozennode\Administrator\AdministratorServiceProvider',
]

Then publish Administrator's assets with php artisan vendor:publish. This will add the file config/administrator.php. This config file is the primary way you interact with Administrator. This command will also publish all of the assets, views, and translation files.

Laravel 4

If you want to use Administrator with Laravel 4, you need to resolve to Administrator 4:

"frozennode/administrator": "4.*"

Then publish the config file with php artisan config:publish frozennode/administrator. This will add the file app/config/packages/frozennode/administrator/administrator.php.

Then finally you need to publish the package's assets with the php artisan asset:publish frozennode/administrator command.

Laravel 3

Since Administrator has switched over to Composer, you can no longer use php artisan bundle:install administrator or php artisan bundle:upgrade administrator. If you want to use Administrator with Laravel 3, you must switch to the 3.3.2 branch, download it, and add it in the /bundles/administrator directory and add this to your bundles.php file:

'administrator' => array(
	'handles' => 'admin', //this determines what URI this bundle will use
	'auto' => true,
),

Documentation

The complete docs for Administrator can be found at http://administrator.frozennode.com. You can also find the docs in the /src/docs directory.

Copyright and License

Administrator was written by Jan Hartigan of Frozen Node for the Laravel framework. Administrator is released under the MIT License. See the LICENSE file for details.

Recent Changelog

5.0.12

  • Bugfix: Added the table name to the constraint query
  • Bugfix: Russian translate in knockout.php
  • Bugfix: Update settings.php for Request::url() instead of using url()

5.0.11

  • Bugfix: Had to make the middleware additon backwards compatable
  • Docs: Added doc updates

5.0.10

  • Bugfix: L5.2 changed the way url() works so added url('/') instead
  • Added: Support for middleware additions to the Admin routes via the administrator config
  • Testfix: Fixed failing tests

5.0.9

  • Bugfix: Fix for datetimepicker partially being covered by top menu

5.0.8

  • Bugfix: Rename Bool class to Boolean to fix PHP 7
  • Bugfix: added missing custom attribute field

5.0.7

  • Bugfix: Fixed boolean true bug
  • Bugfix: Fixes a bug where soft deletes are not being properly detected in L5

5.0.6

  • Added: Support for custom domains in the admin routes
  • Added: Ability to access the model from withinthe column output renderer
  • Added: Dynamic Form Request Validation

5.0.5

  • Added: Added password field to the settings view
  • Added: Romanian Language
  • Added: Basic HasMany Implementation along with re-ordering support
  • Bugfix: Autocomplete working with default value
  • Bugfix: Adding missing session to Admin Controller
  • Bugfix: Fixed improper handling of filter value 0 for Enum/Text field
  • Docfix: Simplified the composer command in the install docs to match the packagist.org instuctions
  • Docfix: Changed the type definition for global_rows_per_page to int instead of Null|nt since Null causes divide by 0 error

5.0.4

  • Testfix: fixing tests and js for gulp

5.0.3

  • Cherry Picking v4.16.7

5.0.2

  • Cherry Picking v4.16.6

5.0.1

  • Bugfix: Fixing csrf token mismatches for some requests

5.0.0

  • Upgraded to Laravel 5
  • New translations (az)

laravel-administrator's People

Contributors

adamfairholm avatar alexsoft avatar alexxli avatar alinghitu avatar amanpatel avatar andrewdworn avatar brunocascio avatar claar avatar crynobone avatar digidworks avatar dmitriyuch avatar endel avatar evgeny-golubev avatar gilr avatar gwill avatar happydemon avatar janhartigan avatar javichito avatar jijoel avatar judgej avatar lokielse avatar martxel avatar morgon avatar neilcrookes avatar shekarsiri avatar spescina avatar stephenantalis avatar teethgrinder avatar weiserwebdev avatar yusuf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-administrator's Issues

Error

Hello there,

I constantly get the following error:
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM contacts WHERE id = ? LIMIT 1' at line 1

SQL: SELECT FROM contacts WHERE id = ? LIMIT 1

Bindings: array (
0 => false,
)

I simply have installed the bundle, created an 'admin' folder in the models dir, created an file called contact.php in the new dir.

This is the config

'models' => array(
    'contact' => array(
        'title' => 'Contacten',
        'model' => 'Contact',
    ),
),

The Frontend itself is working properly.

Any idea how this is come?

Invalid text representation with Postgresql

I have an error :

SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: ""

SQL: SELECT "resultats"."id" FROM "resultats" WHERE "id" = ? LIMIT 1

Bindings: array (
0 => false,
)

it works with an ugly hack on ModelHelper.php :

$model = $classname::find(intval($id), $columns['includedColumns']);

my migration:

Schema::create('resultats',function($table)
{
$table->increments('id');
$table->string('code');
$table->string('name');
$table->string('description')->nullable();
$table->integer('secteur_id');
$table->timestamps();
$table->foreign('secteur_id')->references('id')->on('secteurs');
});

Guillaume.

Object ModelConfig could not be converted to a string

I guess an '__toString' method is missing in the modelConfig class. When i manually add:

public function __toString()
{
    return $this->name;
}

I don't get the error and Administrator is working (as far as i can see now). I guess this isn't the right way to solve that problem. Any ideas?

Input missing in adding/editing table with 1 on 1 relationship

I have this code in array $edit in users.php:

'profile' => array(
      'title' => 'Name',
      'type' => 'relationship',
      'name_field' => 'name',
),

and it generates only:

<div class="has_one">
  <label for="edit_field_profile">
    Name:
  </label>
</div>

without accompanying input.

How can i fix this?

There are two tables: users and profiles. They have 1 on 1 relationship with user_id column inside profiles table.

Self-Relation Column and "select"

Morning.

I just tried to create a self-related column (Category) like so:

'parent_category' => array(
            'title' => 'Parent Category',
            'relationship' => 'parent_category',
            'select' => "(:table).name"
        )

and the column is blank. Model looks like the following:

class Category extends \Eloquent {

    public static $table = 'categories';
    public static $timestamps = true;

    public function profiles()
    {
        return $this->has_many_and_belongs_to('Metadata', 'categories_users_metadata');
    }

    public function parent_category()
    {
        return $this->belongs_to('Category', 'parent_id');
    }

    public function child_categories()
    {
        return $this->has_many('Category','parent_id');
    }

}

Am I missing something?

Filter width

JS generate small width for filter: 21px or 31px
filter_style

Edit box fails to represent peviously selected value in has_one relationship

I am using a has_one belongs_to relationship model. First it works fine, when i create a new row on the belongs_to model side, and i select an item from the other table. I save it, and it saves, in database too. Even when i click on the row (without any browser refresh), the previously selected item shows selected in the select-option area as it should. But if i refresh, or go to an other administrator page, and return back to this menu: edit box fails to show the selected item, instead shows the 'None' option. Also saves it that way afterwords even other fields are edited...

Enum enhancement

I think it will better if we can set display text and value of options by array key,value like this

'options' => array(
    'user' => 'Customer',
    'owner' => 'Merchant',
    'admin' => 'Content Moderator',
    'superadmin' => 'System Administrator'
),

Mass uploading

An idea I just had...let a user upload a bunch of images (or whatever) at once. There would be some mechanism of letting the user keep certain fields persistent to the next entry. This would do a lot in the way of making it easier to manage relationships

Error when used custom primary key

I set

public static $key = 'user_id';

in my model and i got javascript error in console like this

TypeError: $root[$root.primaryKey] is not a function

Suggestion: scroll to top on item click

I have solved this for you :). I'm just not good at github, so read on and maybe you can implement it?

When someone clicks an item on the table, if that item is lower on the page (the page is scrolled down), the view should scroll to the top, cause that's where you can edit that item. To do that, add the following to line 260 of js/admin.js (inside the clickItem event handler):

$('html, body').animate({scrollTop: 0}, 400);

Change the last value (400 ms) to whatever you want for the duration of the scroll animation.

postgresql particularity

Hi,
When you use pgsql, the query contains a group by clause, that's raising an exception (SQLSTATE[42803] column "yourcolumn" must appear in the GROUP BY clause or be used in an aggregate function ).
I fixed it by changing the group_by call with order_by, in ModelHelper class, line 233. That seems to work for me.

One row table model for settings like purpose

In some cases, like "general webpage settings" like admin pages I use only one database table row, so no listing, filtering, creating function necessary, but the editing.

Is there a way to "hack" the admin model to generate page this way, so only editing function appears in menu?

If not (as i think) can we build this feature?

Great Thanks for Administrator, i just love it!

Route Issue Im assuming

I've added everything as you instructed but when i click my models name in the admin panel i get a 404 any suggestions?

How can I create my own admin subpages?

This administrator is great and all, but there are always times when you want to do things differently. Is there a way to add my own subpage (e.g. /admin/complex_user_edit) that I can code myself? Preferably with the same look as the administrator (I know that administrator is coded in Knockout.js, so maybe my page would be standard HTML).

Editing / inserting: enter key doesn't submit

When inserting a new record, the enter key doesn't work as expected (submit the form).

I see that the "form" is not a form but a div.edit_form, so maybe you could change that div to a form and then handle everything else in jquery like so:

$(function() {
    $(".edit_form").submit(function() {
        e.preventDefault();
        // do your magic here
    });
});

I don't know, it's just a guess.

Relationship column doesn't work in some circumstances

When loading a page for a table in admin (in my case /admin/document), I get an error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'documents.document_type' in 'field list'
SQL: SELECT `documents`.`id`, `documents`.`document_type_id`, `documents`.`company_id`, `documents`.`year`, `documents`.`document_type`, `documents`.`company` FROM `documents` WHERE `id` = ? LIMIT 1

I have a Document model and a DocumentType model and I'm using your preferred method of extending existing models (using admin models).
The strange circumstance, that might cause this error, is: the DocumentType model is in a documenttype.php file and uses the document_types table (public static $table = 'document_types';).

I've also got a similar error when displaying DocumentType in browser, cause it belongs_to Country. There I get the error Unknown column 'document_types.country'

Need dropDown and checkbox field

just like Lara Admin they have dropDown and checkbox (and radioButton too but think it can replace with dropDown). I think it'll make FrozenNode more powerful and flexible

and I happy to try to help you write this feature but need some suggestion please :)

Image upload bug using laravel's profiler toolbar

When default profiler toolbar is set to true in laravel's applicatin config file, image gets uploaded properly, but image file name fails to update to table. It's because some extra none-whitespace characters are added by the profiler to the end of response object used in knockout.

Not a big deal, but i got hung on for hours figuring it out.

Just turn off the profiler.

Examples

... Although not really an issue.

I feel like some in depth example code / tutorials would really help this bundle, and me :D. I tend to learn by doing and the documentation here, while quite lengthy tends to leave people like me in the dark without something to dig through.

Ckeditor does not effect the database table

When I use CKeditor as textarea editor , table does not update. here are the errors in the developer tools.

Uncaught TypeError: Cannot call method 'unselectable' of null ckeditor.js:255
Uncaught TypeError: Cannot call method 'getSelection' of undefined ckeditor.js:309
Uncaught TypeError: Cannot read property 'frameElement' of undefined ckeditor.js:61
Uncaught TypeError: Cannot call method 'getSelection' of undefined ckeditor.js:309
Uncaught TypeError: Cannot read property 'frameElement' of undefined ckeditor.js:61
Uncaught TypeError: Cannot call method 'setState' of null ckeditor.js:630

Add map type

Hi! I'm loving this bundle! I want to add a Lat&Long type of field. Can anyone point me in the right direction? Thanks a lot!

BelongTo Relationship

the belong to relationship filter should be = not like because the foreignKey is a integer not a string

Line 45:

$query->where($this->foreignKey, '=', $this->value);

NOT

$query->where($this->foreignKey, 'LIKE', '%'.$this->value.'%');

Allow for relationship fields to be conditional on other relationship fields

This is going to be a tough one, but the way it should work is:

  • You have box office takes
  • You have films and theaters
  • Each box office take is measured in revenue by film by theater.
  • If you select a film in the box office take form, it should limit the theater options that you have to only those films that are in that theater.

Add wysiwyg type

But I need to figure out how to better position the edit box first :(

Wrong redirects if using a subfolder for an app in the URL

I have my app in /localhost/app, so admin is in /localhost/app/public/admin.

All the links to editing tables are correct (e.g. /localhost/app/public/admin/user), but once I click it, I (think I) get redireted to /localhost/admin/user. The page displays correctly (cause it is showing the right URL), but if I refresh, I get a 404. Is the URL changed with javascript or with a PHP redirect?

If it's a bug, can you fix it?

bool field not working correctly

Sorry for my confusing description, I don't think my english is good enough for explain complicated thing 555

but I will try this is my code and all of my bool field is store in db with tinyint (1)

public $edit = array(
    'role' => array(
        'title' => 'Role',
        'type' => 'enum',
        'options' => array(
            'user' => 'User', 
            'owner' => 'Owner', 
            'admin' => 'Admin', 
            'superadmin' => 'Super Admin'
        ),
    ), 
    'account_name' => array(
        'title' => 'Account Name',
        'type' => 'text'
    ),
    'curator_type' => array(
        'title' => 'Curator Type',
        'type' => 'enum',
        'options' => array(
            "00" => 'User', 
            "01" => 'Normal Curator', 
            "02" => 'Fetured Curator'
        ),
    ), 
    'email' => array(
        'title' => 'Email',
        'type' => 'text'
    ),
    'facebook_user' => array(
        'title' => 'Facebook',
        'type' => 'bool',
    ),
    'is_active' => array(
        'title' => 'Active',
        'type' => 'bool',
    ),
    'is_verified' => array(
        'title' => 'Verified',
        'type' => 'bool',
    )
); 
  1. I create new item and checked all my bool checkbox and click 'Create'
  2. I click my new item to open edit window
  3. ok everything fields display correct data and ervery checkbox is checked
  4. I click 'Save' without edit anything
  5. why all of my data in bool field is 0 !!!

Self-related fields not being updated

On issue #33 a fix was made in order to allow self-related models (models related to themselves). However, these fields are not being updated (by using the edit form).

It updates the other fields, but it doesn't update the relation's field.

Allow users to set number of rows in interface

There would be an option in the config that would default to true enabling users to change it. The interface would use a chosen select box that gives options from 5 to 100. Maybe store a session var so they don't have to keep setting it on every page load.

Javascript: Uncaught ReferenceError: loadingOptions is not defined

I have downloaded 2.3 version but now the new item (e.g. new company) link doesn't work (nothing happens) and the filters part of the page is empty.

When I load the model page or the new model page, I get this javascript error: Uncaught ReferenceError: loadingOptions is not defined. Unfortunately, it doesn't say in what line it happens, I know it's strange. I'm using Chrome.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.