Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Oct 30 20:02
    bahman2216 edited #3292
  • Oct 30 20:02
    bahman2216 labeled #3292
  • Oct 30 20:02
    bahman2216 opened #3292
  • Oct 30 16:22
    scrutinizer-notifier commented #2253
  • Oct 30 16:22
    scrutinizer-notifier commented #2253
  • Oct 30 16:19
    promatik commented #3267
  • Oct 30 16:04
    scrutinizer-notifier commented #2253
  • Oct 30 16:04
    scrutinizer-notifier commented #2253
  • Oct 30 16:04

    pxpm on update-date-range-filter

    fix key string Co-authored-by:… (compare)

  • Oct 30 16:04
    pxpm synchronize #2253
  • Oct 30 15:54
    pxpm commented #3267
  • Oct 30 13:10
    promatik commented #3267
  • Oct 30 12:42
    AndresLealColon commented #3290
  • Oct 30 12:23
    promatik commented #2253
  • Oct 30 10:55
    pkuzz commented #3291
  • Oct 30 10:38
    tabacitu commented #191
  • Oct 30 10:37
    pxpm commented #3291
  • Oct 30 10:35
    pxpm assigned #3291
  • Oct 30 10:28
    pxpm assigned #3290
  • Oct 30 10:28
    pxpm unlabeled #3290
Priyank Maniar
@priyankonweb_twitter
@pxpm This may sound like a silly question and I totally understand the answer may not be all accurate but let's say if I purchase unlimited sites for the v4 and if you guys happen to release an update for v5 in some time, what might be the upgrade cost? I understand the amount can vary in the future but it will be nice to have an idea.
Wesley Smith
@DoDSoftware

@priyankonweb_twitter For what its worth, the official FAQ has this to say on the subject:

When we launch new paid versions, we have steep discounts for recent purchases and reasonable discounts for long-time Backpack users. We're very grateful to those that have purchased Backpack.

I'd expect the cost to be fair and reasonable.

Sandeep Nuthalapati
@sandeep045

Hi All, this is Sandeep. Hope everyone is doing good.

I've been using Laravel Backpack and it's awesome admin features helped me build the admin panels pretty quick. Recently, I was working on a custom operation, which have edit page only. When a user logged in to the backend, I would like to take the logged in user id and get data based on it. The result(data from the db) should show in the edit page form.

I've setup the operation route(it won't have a parameter in the route), a method which displays the form view and they all working. When I go to the route, I can see the form, but not the data. I've tried setting the crud query in the controller. Also set data entry value, but still no luck with field values from database.

Can anyone help me out. Thanks

Wesley Smith
@DoDSoftware
Hi @sandeep045 Perhaps you could start a question on stackoverflow where you could post your code so far and we could review? We could probably help more if we can see those details. If you do, post a link here and we'll shoot over and take a look!
Guillermo Baron
@guillorrr
Hi! I don't understand how to use the data sent through include_main_form_fields to set a select field in setupInlineCreateOperation? Thanks for your help!
Sandeep Nuthalapati
@sandeep045
@DelightedD0D Thanks. I'll do it.
Wesley Smith
@DoDSoftware

Hi everyone, I've created an addon for Backpack that extends the CrudPanel providing the ability to dynamically set the 'hint' value for its CRUD fields by pulling the "comment" for the related column in the database if it exists.

Github

Packagist

@tabacitu we originally discussed this idea here DoDSoftware/CRUD#1

Anybody want to try out the package and possibly provide feedback?

Pedro Martins
@pxpm
@guillorrr $form = request('form'); foreach($form as $input) { ... }
for reference
this is not merged but you can see the code.
Guillermo Baron
@guillorrr
@pxpm obrigado!
Arkadiusz Chmura
@ClouddJR
Hi, if I understand correctly, the license code that I purchase is verified every time someone enters a backpack panel on my website. What kind of warranty do I have that the server that checks the validity of the license will not go down one day?
Wesley Smith
@DoDSoftware
@ClouddJR License codes are verified using an obfuscated internal mechanism, no remote servers involved.
Priyank Maniar
@priyankonweb_twitter
@DelightedD0D Thanks Wesley for your response :)
Marcus
@marcus-at-localhost
Hi, can I have an autocomplete field in a table field? or turn one/two of the textfields into an autocomplete?
Marcus
@marcus-at-localhost

The docs say about Custom Queries v4.1:

$this->crud->orderBy();
// please note it's generally a good idea to use crud->orderBy() inside "if (!$this->request->has('order')) {}"; that way, your custom order is applied ONLY IF the user hasn't forced another order (by clicking a column heading)

But $this->request->has('order') throws an exeption

ErrorException
Undefined property: App\Http\Controllers\Admin\GasketCrudController::$request

Is that advice maybe outdated?

Arkadiusz Chmura
@ClouddJR
@DelightedD0D Thanks for quick answer ;)
Another question, will Backpack work with Laravel 8.0?
Pedro Martins
@pxpm
@marcus-at-localhost you should use $this->crud->getRequest() or the global helper request()
indeed, docs need to be updated, i will try to don't forget to update them tomorrow
@ClouddJR backpack already supports L8 !
thanks :)
acewebsa
@acewebsa
Hey @anasred - I managed to do this in a couple projects.
in your controller in setup function use $this->crud->setShowView( 'contacts.show_contact' );
Then in your view file do a foreach in a table eg
<?php foreach ($entry->audits as $audit):?>
<?=$audit->id?>
<?php endforeach;?>
acewebsa
@acewebsa

hey guys. Just wondering if anyone knows how to get the file type from an upload file in backpack, and also file size.

If I use pathinfo it returns extension of tmp, which doesn't help.

public function setFileNameAttribute( $value ) {
        $attribute_name = "file_name";
        $disk           = "public";
        $destination_path = "files/" . $this->attributes['project_id'];
        $path = pathinfo( $value );
        $this->uploadFileToDisk( $value, $attribute_name, $disk, $destination_path );
        $this->attributes['file_type'] = $path['extension']; // returns tmp
    }
Wesley Smith
@DoDSoftware
@acewebsa It seems odd to have the upload functionality inside a model's mutator method. That said, the following code is untested but should do what you need:
$file = request()->file($attribute_name);
$mimeType = $file->getMimeType(); // trusted value uses finfo(), better to use this
$extension = $file->getClientOriginalExtension() // extracted from the original file name that was uploaded, ie, not trust worthy but it is an option
$size = $file->getSize();
paperscissors
@paperscissors
Hey folks, I'm using v4.1 over here --- I have a strange thing going on where I try to use the relationship field type on an n-n relation with ajax searching enabled. When I try to search for a relation I get a 405 Method Not Allowed when I look at the console. Is there some step I am missing in regards to creating a route, etc here that's not listed in the docs? The endpoint it's trying to reach is /admin/{entity}/fetch/{relations}.
jorgepires
@jorgepires
Hi guys, I need some help on handling select options (set/get) due to angular, I have zero knowledge on angular, is there anyone available to sell some of your time to help me overcome this issue? It is related to have a select on change event modifying another select
Wesley Smith
@DoDSoftware
@paperscissors Does your crud controller have a use statement like use \Backpack\CRUD\app\Http\Controllers\Operations\FetchOperation;?
@jorgepires We'd be happy to help, the best format might be to post your question on stackoverflow.com where you can show your code and explain the issue, tag that question with the "backpack-for-laravel" tag, then drop a link to that question here.
Guillermo Baron
@guillorrr

Hi! I have a custom pivot table (evaluation_id, thread_id, question_id), and I'm using the select_multiple field in create to query the relationship

class Evaluation extends Model

public function questions()
{
        return $this->belongsToMany(Question::class, 'evaluation_question')->withPivot('thread_id');
}

This is my crud field

CRUD::addField([       // Select_Multiple = n-n relationship
    'label'     => 'Select_Multiple',
    'type'      => 'custom_select',
    'name'      => 'questions',
    'entity'    => 'questions',
    'attribute' => 'title',
    'model'     => Question::class,
    'pivot'     => true,
    'pivotFields' => [
        'thread_id' => 'thread_id',
    ],
    'tab'       => __('base.questions'),
    // 'wrapperAttributes' => ['class' => 'form-group col-md-12'],
]);

How to set a default value in the pivot field like thread_id = 2?

Wesley Smith
@DoDSoftware
@guillorrr there doesn't appear to be any functionality built in that would allow us to set defaults for a pivotFields column. An alternative might be to set a default value for that column on the database table itself. Would that work for your use case?
jorgepires
@jorgepires
Hi @DelightedD0D , thank you for your input, I have added my question in stackoverflow https://stackoverflow.com/questions/63973518/laravel-backpack-javascript-dynamic-change-of-select-option
acewebsa
@acewebsa
Thank you so much @DelightedD0D - That worked fantastic. Thanks
Wesley Smith
@DoDSoftware
@acewebsa Awesome, glad to hear it! Happy coding :)
Sami Greenbury
@Patabugen
image.png
image.png
The datetime_picker field suggests adding this setDateTimeAttribute to my model - but it doesn't say what the \Date::parse class is. What should I import for that?
paperscissors
@paperscissors
@DelightedD0D it doesn't --- I just tried to add it in and I still get this 405 error.
I see the bits about fetchTag however, I will try those.
paperscissors
@paperscissors
No luck even with an explicit fetchTag definition. Here's the error: The POST method is not supported for this route. Supported methods: GET, HEAD.
Here's what I added to the controller per the docs.
<?php
use \Backpack\CRUD\app\Http\Controllers\Operations\FetchOperation;

    protected function fetchTag()
    {
        return $this->fetch([
            'model' => \App\Models\Creator::class, // required
            'searchable_attributes' => ['name'],
            'paginate' => 10, // items to show per page
            'query' => function($model) {
                return $model->active();
            } // to filter the results that are returned
        ]);
    }
Wesley Smith
@DoDSoftware
@Patabugen that's referring to the laravel facade, you shouldn't have to import it, but you can for IDE typehinting purposes and such via use Illuminate\Support\Facades\Date;
1 reply
Wesley Smith
@DoDSoftware
@paperscissors what is the actual name of the relationship you're attempting to fetch? ie, what is the name of the method on the main model that returns the relationship? if it is creator, please try updating protected function fetchTag() to protected function fetchCreator() and ensure that the 'name' in your field configuration is also set to creator
Wesley Smith
@DoDSoftware
@paperscissors also worth noting, you probably dont actually want the 'query' option shown in the example call to fetch, unless your Creator model actually has a scopeActive method on it. That's just an example showing how you can modify the query it will run to apply some conditions.
Timmy
@PouakaiNz
Hey, Can I on page load default order by a col that has custom orderLogic on it with $this->crud->orderBy('') ?
Timmy
@PouakaiNz
Sorted it with $this->crud->customOrderBy
ShekharKokate
@ShekharKokate
Hi everyone,
I want to open media gallery in backpack when click on browse.
I have added file manager and the images are stored in amazon s3.
Please help me, how can I open the media gallery?
Wesley Smith
@DoDSoftware
Hi @ShekharKokate Im not sure I understand the issue. Perhaps you could open a question on stackoverflow.com, post your question and code, and tag it with backpack-for-laravel, then post the link here? That format would allow us to help you a lot more effectively.