exodusanto / laravel-admin Goto Github PK
View Code? Open in Web Editor NEWLaravel-Admin is the new version of Laravel-Administrator of Frozennode
License: MIT License
Laravel-Admin is the new version of Laravel-Administrator of Frozennode
License: MIT License
Laravel 5.7.25
Laravel-Admin v5.7.0
PHP v7.1.8
This was working for me at one time, but I recently noticed it's now broken. I can't get any image to upload. I made sure I had the latest version of the package.
I'm attempting the basic upload (no complicated options):
'header_img' => array(
'type' => 'image',
'title' => 'Header Image',
'location' => public_path() . '/uploads/buttons/headers/',
'naming' => 'random',
'length' => 20,
),
The directory exists, and as mentioned before, this was working for me.
Anyone having this issue? I've tried placing the original image to upload in c:/tmp, to eliminate any strange upload paths that might cause an issue.
Please reply to help me, and I thank you in advance.
went in and typed /admin at url and got this error
InvalidArgumentException in Factory.php line 106:
There are problems with your administrator.php config: The model config path option must be a valid directory. The settings config path option must be a valid directory. The menu field is required.
Laravel version: 5.8.35
PHP version: 7.2.22
exodusanto/administrator version: 5.8.0
There is a problem with two method names inherited from Illuminate/Database/Eloquent/Relations/Relation.php
Method getOwnerKey() is named getOwnerKeyName() and method getForeignKey() is named getForeignKeyName().
In file Fields/Relationships/BelongsTo.php:
line 32: $options['foreign_key'] = $relationship->getForeignKeyName();
In File Columns/Relationships/BelongsTo.php:
line 115: ' = ' . $last_alias . '.' . $relationship->getForeignKeyName();
line 126: $where = $this->tablePrefix . $first_model->getTable() . '.' . $first_relationship->getForeignKeyName() .
line 144: $fk = $nested['models'][0]->{$nested['pieces'][0]}()->getForeignKeyName();
-line 114: ' ON ' . $alias . '.' . $relationship->getOwnerKeyName() .
I've tested Laravel-Admin with Laravel 8 / PHP8 in local dev setup for a few months and just went live.
Im getting this message deprecated message:
Got error 'PHP message: PHP Deprecated: Required parameter $fields follows optional parameter $id in /website/vendor/exodusanto/administrator/src/Frozennode/Administrator/Config/Model/Config.php on line 114 PHP message: PHP Deprecated: Required parameter $columns follows optional parameter $id in /website/vendor/exodusanto/administrator/src/Frozennode/Administrator/Config/Model/Config.php on line 114'
Does this package support Laravel 9 and PHP 8?
Trying to upload a file or image results in Class 'Illuminate\Support\Facades\Input' not found error in vendor/exodusanto/administrator/src/Frozennode/Administrator/Includes/Multup.php
Illuminate\Support\Facades\Input was removed in Laravel 6, should instead be using the Request facade.
I am using version 8.0.0
Hey, just wondering if there's any plans to update this to 5.8?
Either way, thanks so much for the stellar work maintaining this! It's freed me to upgrade my laravel project all the way from 5.2 to 5.7.
Hi there,
So I've completed my upgrade from Laravel 4.2 to 5.4, and I've got a working version in a temporary directory. When I go to move all the files into the local git repository directory in preparation for a commit and send up to the repository on bitbucket, I'm now receiving this error on any page access or on a:
php artisan clear-complied
php artisan cache:clear
Now I'm fully aware that your version provides for a workaround for share being removed. and having to use the singleton instead. And this error didn't come up in the Laravel 5.4 directory. So I'm sure it had something to do with something that is left over from the Laravel 4.2 version, but I can't figure out what.
I've deleted the files in the framework/cache/data and framework/views directories. Any ideas on what would be causing this?
I identified an issue with the Frozennode/Administrator/Includes/Multiup.php logic when using plUpload with the chunk_size option. It assumes that an extension should be identified for the uploaded file (rightly so in cases where 'chunk_size' is not implemented), but in the case of a blob/chunk, there is no extension for it. See the code snippet below:
if ($this->random == "random") {
if (\is_callable($this->random_cb)) {
$filename = \call_user_func($this->random_cb, $original_name);
} else {
$ext = File::extension($original_name);
$filename = $this->generate_random_filename() . '.' . $ext;
}
}
It appears there was some development to utilize a random_cb callback function, but there's no documentation for it, and I can't get it to work. I've tried:
'random_cb' => function()
{
return \Str::random(50);
},
and
'random_cb' => 'generate_random_filename',
but neither worked .
Can there be a fix to only add an extension to the uploaded file if a file extension exists?
Thanks for your time in reading/replying to this, and for maintaining this package.
I am using this package for the admin panel. But when I tried to run PHP artisan config:cache. it returns an error because of the closure function.
https://i.imgur.com/mqFPw0b.png
Your configuration files are not serializable.
Laravel 5.7.25
Laravel-Admin v5.7.0
PHP v7.1.8
I'm trying to replicate code that is similar to what I've done here:
`'
role_names' => array(
'title' => 'Role',
'relationship' => 'roles',
'select' => 'GROUP_CONCAT((:table).display_name ORDER BY display_name ASC SEPARATOR ", ")',
),
`
and it's a nested relationship (using dot notation), which hasn't been a problem before:
`
'facility_master' => array(
'title' => 'Facility Name',
'relationship' => 'facility.entity',
'select' => '(:table).name',
),
`
except that it includes the use of the hasMany relationship.
class Reservation extends Model { ... public function reservedrooms() { return $this->hasMany('App\reservedroom'); }
Here's my test scenario:
`'last_names' => array(
'title' => 'Guest Name(s)',
'relationship' => 'reservation.reservedrooms',
'select' => 'version()',
// 'select' => 'GROUP_CONCAT((:table).guest_name ORDER BY guest_name ASC SEPARATOR ", ")',
),`
As you can see, I've commented out what I really want done, and just used a SELECT that I know works, to narrow down issues coming from another part/property of the column array.
Set relationship to 'reservation' ... works.
Set relationship to 'reservation.facility' ... works. (belongsTo relaitonship)
Set relationship to 'reservation.promotions' ... same as 'reservation.reservedrooms'.
All of these relationships are being used throughout the website and are not new.
What exactly happens when adding a hasMany or belongsToMany? Blank screen, and no syntax/error output in the PHP log or the Javascript Console log. I've placed debug statements in:
DataTable/Columns/Column.php
DataTable/Columns/HasOneOrMany.php
DataTable/Columns/Relationships/Relationship.php
and nothing gets sent to the log when the blank screen occurs.
Hoping I can get a reply or a solution to this. Many thanks!
Hi.
Im completely new to laravel. I'm looking at an old laravel app >>https://github.com/jonstavis/prelaunchr-laravel << and Im slowly working my way through different packages that would need to be changed.
Can this package be used with larael v7.0 ???
If it can't, is/are there any changes that can be implemented to make the package valid to be used in a laravel v7 app?
thanks
-bruce
After installing your package, we are facing an issue when caching the config with
PHP artisan config: cache. It is a closure-related issue that occurs when using the callback function in config files as you have suggested here https://github.com/exodusanto/Laravel-Admin/blob/master/docs/fields.md#editable-option.
https://i.imgur.com/mqFPw0b.png
Error: Your configuration files are not serializable.
We have checked many third-party packages and they solved it. It is closure related issue.
Here is laravel/framework#9625 the other suggested solutions for this.
Can you please check this and update your laravel-admin package accordingly.
Let me know if you will work on it or not? Are you going to raise PR?
Laravel: 8
Php: 8.1
We are facing an issue when caching the config with
PHP artisan config: cache. It is a circular references-related issue and we have also faced issue-related closure that occurs when using the callback function in config files as you have suggested here https://github.com/exodusanto/Laravel-Admin/blob/master/docs/fields.md#editable-option.
https://i.imgur.com/Fxcb7Pt.png
Error: var_export does not handle circular references
We have tried this but not working:-
Please guide me on how to solve this error when configuring the cache.
Is it possible to ignore this error when config cache or any way to handle this so error should not be reported?
Please guide me how to solve this ?
[email protected], [email protected], t
Hi Jan/Antonio
You don't know me. We've never talked. I'm hoping one or more of you, might be willing to help me figure out if your app/package ("frozennode/administrator") is suitable for an app/project within Github.
I'm looking to possibly port an older Github/Laravel App. The app --https://github.com/jonstavis/prelaunchr-laravel, apparantly uses the v5.8 version of Laravel. Given that I'm running v7 of Laravel, I'm trying to see what would be required to mod the pelaunchr app to get it to run for Laravel v7.
I'm at the point where I'm examining the
"frozennode/administrator": "5.*", <<<
which runs at v5.
Unfortunately this app/package is no longer supported. Searching Github/Packagelist gets me to the >>>Lavael-Admin <<< or https://github.com/exodusanto/Laravel-Admin.
Is this app/package a replacement for the "frozennode/administrator" app/package?
If it is a "replacement", can it be modified to work with the current version v7 of Laravel instead of the v5.8 Laravel?
Look forward to talking to you about what I should do for this situation!
Thanks
-bruce
Hi Antonio.
I'm trying to install/run/use the Laravel-Admin app for an older Laravel app.
I'm extremely new to Laravel so I might be making all kinds of mistakes.
The app I'm working with is https://github.com/jonstavis/prelaunchr-laravel.
I've made a number of changes to the app including the composer.json file, and I've managed to get the frontside of the app working.
The readme.md of the prelaunchr app states that I can access the "admin" of the site by doing a http://1.2.3.4/admin
However when I do this, I get a stack trace. In talking to a number or people in the laravel channel on IRC I've been told that there are different changes with laravel 7.
It appears that the Routes/Controllers and middleware need to be changed/updated.
Again given that I have no clue how this is supposed to work, I'm at a loss.
I'd greatly appreciate if you can talk to me on this issue.
Depending on what needs to be done I might be able to offer you some compensation. This is for me to be able to get a better understanding of how some of Laravel works.
Thanks much
-bruce
[email protected]
Hi Antonio,
There's a bug in Boolean Filters where the $this->validator->arrayGet method returns a value with the gettype() of 'NULL', when it's normally a 'string'. I am only seeing this issue when you have another filter in use (ie datetime, string, relationship). It causes the query to include the boolean filter when it's not being used, providing erroneous results.
My solution is in Frozennode/Administrator/Fields/Boolean, and I check to make sure the gettype is NOT 'NULL', as it gets switched to an 'integer' within setFilter. The 2 changes are shown below (end of Boolean.php), look for gettype($this->userOptions['value']) != 'NULL' && :
/**
* Sets the filter options for this item
*
* @param array $filter
*
* @return void
*/
public function setFilter($filter)
{
parent::setFilter($filter);
$this->userOptions['value'] = $this->validator->arrayGet($filter, 'value', '');
//if it isn't null, we have to check the 'true'/'false' string
if (gettype($this->userOptions['value']) != 'NULL' && $this->userOptions['value'] !== '')
{
$this->userOptions['value'] = $this->userOptions['value'] === 'false' || !$this->userOptions['value'] ? 0 : 1;
}
}
/**
* Filters a query object
*
* @param \Illuminate\Database\Query\Builder $query
* @param array $selects
*
* @return void
*/
public function filterQuery(QueryBuilder &$query, &$selects = null)
{
//if the field isn't empty
if (gettype($this->userOptions['value']) != 'NULL' && $this->getOption('value') !== '')
{
$query->where($this->config->getDataModel()->getTable().'.'.$this->getOption('field_name'), '=', $this->getOption('value'));
}
}
Let me know if there's anything else you need.
'filters' => array( 'roles' => array( 'type' => 'relationship', 'title' => 'Roles', 'name_field' => 'name' ), ..
Error:
Column already exists: 1060 Duplicate column name 'role_id' (SQL: SELECT COUNT(id) AS aggregate FROM (select users
.*, role_user
.role_id
from users
inner join role_user
on users
.id
= role_user
.user_id
where role_user
.role_id
in (1) and users
.deleted_at
is null group by users
.id
having COUNT(DISTINCT role_user.role_id) = 1) AS agg) in .../vendor/laravel/framework/src/Illuminate/Database/Connection.php:647
Have you this error?
I am trying to disable sorting for a specific column using sortable but it is not working. The column is Eloquent Accessors.
'sortable' => false,
https://i.imgur.com/p0feeor.png
Local Environment PHP Version: 5.6.4
Production Environment PHP Version: 7.0.19
I experienced this in my local environment for the permission config value, since it's a function, and function closures are no longer acceptable in Laravel 5.4. The solution was to create a Custom Helper. I did not experience any issues with the individual Model Config files, but when I moved the code up to production, I found that I was getting this error for all the functions inside the Model Config files. An example:
'output' => function($value) {
return ( floor($value*100) == $value*100 ? number_format($value*100, 0) : number_format($value*100, 2, '.', '') ).'%';
}
The work to create Helpers for these Config files will be significant, as I am using the Administrator for 2 different menus, for 2 different roles, and the ability to create/update/delete changes frequently, depending on the model.
Is there a work around I am missing here, or will I have to create Custom Helpers for the individual model config files as well?
Hi there,
I'm doing an upgrade from Laravel 4.2 to 5.4, and am making use of the Frozennode Administrator, where it worked quite adequately in 4.2. I'm using:
"exodusanto/administrator" : " 5.4.*",
"frozennode/administrator" : "^5.0",
and have placed the appropriate config files in their respective areas. I'm using the DB facade here (in one of the model configs):
'filters' => array(
'user_id' => array(
'title' => 'User',
'type' => 'enum',
'options' => DB::table('users')->where('confirmed', '=', 1)->orderBy('username', 'asc')->lists('username'),
),
),
and am receiving the Fatal error in the title.
Is this a situation where I need to use a Service Provider in some fashion? If so, can you give me an example of how this is done?
Can anyone who is utilizing the Admin where your model has a polymorphic relationship tell me whether you need the namespace to be in the database type field? I tried to upgrade the system I created by not storing the namespace (utilizing $morphClass in morph model and alias $types in the model they share), but saving/updating models in the Administrator includes the namespace.
When I perform a setup where the namespace IS included (ie App\Facility), I get the following error when I try to save/update:
[2017-06-07 17:16:49] local.ERROR: exception 'ErrorException' with message 'trim() expects parameter 1 to be string, array given' in C:\xampp\htdocs\tikitour\vendor\exodusanto\administrator\src\Frozennode\Administrator\Config\Model\Config.php:488
Anyone out there with some advice/explanation? Greatly appreciated.
Antonio,
If it would help, I can provide you the stack trace as well as even give you access to the VM where the test app is currently running.
Thanks
-bruce
[email protected]
Configuration cache cleared!
LogicException : Your configuration files are not serializable.
at master/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Console/ConfigCacheCommand.php:68
64| require $configPath;
65| } catch (Throwable $e) {
66| $this->files->delete($configPath);
67|
68| throw new LogicException('Your configuration files are not serializable.', 0, $e);
69| }
70|
71| $this->info('Configuration cached successfully!');
72| }
Exception trace:
1 Error::("Call to undefined method Closure::__set_state()")
master/laravel/bootstrap/cache/config.php:650
2 require()
master/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Console/ConfigCacheCommand.php:64
Every thread says delete this file "master/laravel/bootstrap/cache/config.php", but this file does not even exist. How can a file throw an error that is not even there?
I'm doing an upgrade from Laravel 4.2 to 5.4, and am making use of the Frozennode Administrator, where it worked quite adequately in 4.2. I'm using:
"exodusanto/administrator" : " 5.4.*",
"frozennode/administrator" : "^5.0",
My menu displays on the page (had to comment out one option that is unique to try and resolve major issues first), but any requests to access the models within the menu system results in 2 errors: 1/2 is in this title, and 2/2 is below:
QueryException in Connection.php line 647:
SQLSTATE[42000]: Syntax error or access violation: 1055 '[db_name].[db_table].[db_table_column2]' isn't in GROUP BY (SQL: SELECT COUNT(id) AS aggregate FROM (select facility_transfers
.* from facility_transfers
where to_provider_id
is null group by facility_transfers
.id
) AS agg)
My db_name is tikitour_main, my db_table is whatever table I'm trying to access, and my db_table_column2 is the 2nd column of every table I'm trying to access.
Has anyone else experienced this?
UPDATE: Strangely, the actual SQL statement attempted (and displayed) works fine from the command line.
Hello,
is there an update is sight to support Laravel 10 and php 8.1?
Or is there an alternative, which has this support?
Mockery Version
1.4.x-dev
PHP Version
PHP 8.0
Issue Description
I have use composer require exodusanto/administrator package in this package dependency to mockery package and I have use exodusanto/administrator 8.1.0 that require mockery version 1.4.x-dev that no available in packagiest so got below error:
Problem 1
Firstly, great job getting this working with L5.4 and I like the font too.
Im fairly sure this count of related (one2many) items worked in L5.1. But now returns 0. Could you try a similar count on your setup and see?
'columns' => array( 'num_addresses' => array( 'title' => 'Number of', 'relationship' => 'addresses', 'select' => "COUNT((:table).id)", ),
I'm looking at upgrading my Laravel app soon and need to know if this great admin will be updated to run on Laravel 8 or if there are any problems running it on that version?
I want to redirect to the list page after performing a custom action.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.