Code Monkey home page Code Monkey logo

Comments (10)

pxpm avatar pxpm commented on June 9, 2024 1

@dividy could you check if #100 fixes it?

Best,
Pedro

from generators.

dividy avatar dividy commented on June 9, 2024 1

I was about to submit this :

$file_array = preg_split('/\r\n|\r|\n/', $file);

Beat me to it 😄

Your PR works 👍

Model already exists! We just added CrudTrait on it.
Request already exists!
Route already exists!
Sidebar item already exists!

from generators.

welcome avatar welcome commented on June 9, 2024

Hello there! Thanks for opening your first issue on this repo!

Just a heads-up: Here at Backpack we use Github Issues only for tracking bugs. Talk about new features is also acceptable. This helps a lot in keeping our focus on improving Backpack. If you issue is not a bug/feature, please help us out by closing the issue yourself and posting in the appropriate medium (see below). If you're not sure where it fits, it's ok, a community member will probably reply to help you with that.

Backpack communication mediums:

  • Bug Reports, Feature Requests - Github Issues (here);
  • Quick help (How do I do X) - Gitter Chatroom;
  • Long questions (I have done X and Y and it won't do Z wtf) - Stackoverflow, using the backpack-for-laravel tag;

Please keep in mind Backpack offers no official / paid support. Whatever help you receive here, on Gitter, Slack or Stackoverflow is thanks to our awesome awesome community members, who give up some of their time to help their peers. If you want to join our community, just start pitching in. We take pride in being a welcoming bunch.

Thank you!

--
Justin Case
The Backpack Robot

from generators.

pxpm avatar pxpm commented on June 9, 2024

Hello @IazLur

Thanks for the bug report.

I just transfered your issue to the correct repository.

Could you please provide some more info with: php artisan backpack:version and gives us info what version of generators you are loading in your composer.json ?

Thanks in advance,
Pedro

from generators.

IazLur avatar IazLur commented on June 9, 2024

PHP VERSION:

PHP 7.3.12 (cli) (built: Nov 19 2019 13:58:02) ( ZTS MSVC15 (Visual C++ 2017) x64 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.12, Copyright (c) 1998-2018 Zend Technologies

LARAVEL VERSION:

v8.6.0@a71952a6dba55de0bb11b5fbbd84874eda2a755c

BACKPACK VERSION:

4.1.25@23fb1ed5153d5465d49d2fe1ca265a5985c78877

"require-dev": {
"backpack/generators": "^3.1",
"facade/ignition": "^2.3.6",
"fzaninotto/faker": "^1.9.1",
"laracasts/generators": "^2.0",
"mockery/mockery": "^1.3.1",
"nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^9.3"
},

@pxpm

from generators.

tabacitu avatar tabacitu commented on June 9, 2024

Hmm that's weird. It worked fine for me:
Screenshot 2020-09-29 at 14 01 29

@IazLur by any chance did you already have a Bug.php model? If so, we're going to need the code inside Bug.php BEFORE Backpack made any changes to it, to detect what the problem was... What happens is the Backpack tries in this case to add use the CrudTrait inside your existing model. But, depending on how your model is coded, it might fail in some very particular cases. We just need to understand what that particular case is 😄

from generators.

IazLur avatar IazLur commented on June 9, 2024

Hi, I tried to understand where was the bug but I didn't found.
Here is the Bug.php before I made the command.

`<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\Relations\BelongsTo;;

class Bug extends Model
{
use HasFactory;

/**
 * @var string
 */
protected $table = 'bugs';

/**
 * @var array
 */
protected $guarded = [];

/**
 * @return BelongsTo
 */
protected function bugGame()
{
    return $this->belongsTo(BugGame::class);
}

/**
 * @return HasMany
 */
protected function bugMedias()
{
    return $this->hasMany(BugMedia::class);
}

/**
 * @return BelongsTo
 */
protected function bugType()
{
    return $this->belongsTo(BugType::class);
}

/**
 * @return BelongsTo
 */
protected function gameVersion()
{
    return $this->belongsTo(GameVersion::class);
}

}`

from generators.

dividy avatar dividy commented on June 9, 2024

Your model already exists.

Remove it and try again the command.

from generators.

dividy avatar dividy commented on June 9, 2024

On my side, the bug seems to be with the file being read as 1 big line.

Problem might be here :

$file_array = explode(PHP_EOL, $file);

from generators.

tabacitu avatar tabacitu commented on June 9, 2024

Thanks guys!

The PR was merged and tagged, a composer update should fix it (by getting backpack/generators 3.1.4). So let's close this.

Cheers!

from generators.

Related Issues (20)

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.