laravel-enso / addresses Goto Github PK
View Code? Open in Web Editor NEWFree-form addresses manager
Home Page: https://docs.laravel-enso.com/#addressesmanager
License: MIT License
Free-form addresses manager
Home Page: https://docs.laravel-enso.com/#addressesmanager
License: MIT License
This is a bug(windows).
Has any of you got this error on composer update:
- Installing laravel-enso/addresses (4.6.17): Extracting archive
Install of laravel-enso/addresses failed
- Installing symfony/var-exporter (v5.3.7): Extracting archive
- Installing symfony/cache-contracts (v2.4.0): Extracting archive
- Installing symfony/cache (v5.3.7): Extracting archive
- Installing squizlabs/php_codesniffer (3.6.0): Extracting archive
- Installing slevomat/coding-standard (7.0.15): Extracting archive
- Installing symfony/stopwatch (v5.3.4): Extracting archive
- Installing symfony/filesystem (v5.3.4): Extracting archive
- Installing seld/phar-utils (1.1.2): Extracting archive
- Installing seld/jsonlint (1.8.3): Extracting archive
0 [>---------------------------]
[RuntimeException]
The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems): ZipArchive::extractTo(c:\myproject/vendor/composer/267b1069/laravel-enso-addresses-86d7466\
database\cities\GBR/CON.json): Failed to open stream: Invalid argument
[ErrorException]
ZipArchive::extractTo(c:\myproject/vendor/composer/267b1069/laravel-enso-addresses-86d7466\database\cities\GBR/CON.json): Failed to open stream: Invalid argument
This happens on windows.
I've tried composer clearcache
. Not working.
This is a bug.
1 Doctrine\DBAL\Driver\PDOException::("SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 74")
/vagrant/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:82
2 PDOException::("SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 74")
/vagrant/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:80
mass import for application setup
Ideas:
This is a bug | feature request.
My address table allows for nullable fields and as such the getLabelAttribute causes an exception Trying to get property 'name' of non-object
.
Would it be possible to change getLabelAttribute to below? Or do you suggest I approach this differently?
Suggested
public function getLabelAttribute()
{
$label = collect([
trim($this->number ?? ''.' '.$this->street ?? ''),
$this->city ?? '',
$this->country->name ?? '',
])->filter()
->implode(', ');
..........
Original
public function getLabelAttribute()
{
$label = collect([
trim($this->number.' '.$this->street),
$this->city,
$this->country->name,
])->filter()
->implode(', ');
.........
Make city, country_id nullable.
I merged in master branch of Enso today and updated with composer update.
AddressesManager package was not downloaded (it should be linked from Enso core).
Do I have to add it somewhere to composer.json?
I use the following package to handle the countries table:
webpatser/laravel-countries
It provides a Seeder for a pre filled countries table (with a lot of additional information to each country).
Maybe it's interesting for you to change to this package?
Otherwise I have to find a solution to migrate your countries table to mine or vice versa.
This is a ** query **
I am trying to seed random addresses to then assign to work orders. The trait requires me to use
`<?php use App\User;
$factory->define(LaravelEnso\AddressesManager\app\Models\Address::class, function (Faker\Generator $faker) {
$user = User::find(1);
Auth::login($user);
return [
'addressable_type' => "App\WorkOrder",
'addressable_id' => $faker->randomElement(\App\WorkOrder::pluck('id')->toArray()),
'street' => $faker->name,
'street_type' => 'Street',
'number' => $faker->biasedNumberBetween($min = 0, $max = 140, $function = 'sqrt'),
'postal_area' => $faker->postcode,
'city' => $faker->city,
'country_id' => 235,
'created_by' => 1,
];
});
otherwise I get:
ErrorException : Trying to get property 'id' of non-object
at /vagrant/vendor/laravel-enso/trackwho/src/app/Traits/CreatedBy.php:10
6| {
7| protected static function bootCreatedBy()
8| {
9| self::creating(function ($model) {
10| $model->created_by = auth()->user()->id;
11| });
12| }
13|
14| public function createdBy()
Exception trace:
1 Raven_Breadcrumbs_ErrorHandler::handleError("Trying to get property 'id' of non-object", "/vagrant/vendor/laravel-enso/trackwho/src/app/Traits/CreatedBy.php", [Object(LaravelEnso\AddressesManager\app\Models\Address)])
/vagrant/vendor/laravel-enso/trackwho/src/app/Traits/CreatedBy.php:10
2 LaravelEnso\AddressesManager\app\Models\Address::LaravelEnso\TrackWho\app\Traits{closure}(Object(LaravelEnso\AddressesManager\app\Models\Address))
/vagrant/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:360
`
Expected to happen as requires created by, but there must be a better way than me creating a user object? Can I bypass a trait? Is there a way to default created by to id 1?
in case an entity has lots of addresses defined, the default one should the first one visible in the list
we have both user and owner, and are currently using only the owner for enso
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.