Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/05/2022 in all areas

  1. It's a class that can be iterated with foreach. It is not an array, but it has many eloquent specific capabilities you can read about here: https://laravel.com/docs/9.x/eloquent-collections. For example it has a method that will return all the primary key values of all the models in the collection. Keep in mind that it extends the Laravel collection base class, which has many more methods that might be useful depending on what you want to do. See https://laravel.com/docs/9.x/collections
    1 point
  2. try <?php require 'code128.php'; $data = ['item_name' => 'Fuel Vapour Hose' ,'code_purchase' => 'ABC-2342' ,'code_sale' => 'DFS-4312' ,'item_code' => '47900001' ]; class Barcode_Label extends PDF_Code128 { protected $data; //constructor public function __construct() { parent::__construct('L','mm',[60, 35]); } public function printLabel($data) { $this->setMargins(5,5,5); $this->SetAutoPageBreak(0); $this->AddPage(); $this->setFont('Times', 'B', 10); $this->Cell(50, 5, $data['item_name'], 0, 1, 'C'); $this->Cell(25, 5, $data['code_purchase'], 0, 0, 'C'); $this->Cell(25, 5, $data['code_sale'], 0, 1, 'C'); $barcode = $this->Code128( 5,15,$data['item_code'],50,10); $this->setY(25); $this->Cell(50, 5, $data['item_code'], 0, 1, 'C'); $this->ln(2); } } #Barcode_Label $label= new Barcode_Label(); for ($i=0; $i<3; $i++) { $label->printLabel($data); } $label->Output(); ?>
    1 point
  3. First only returns a single item, so there's no point in putting it in a collection. The collection is for methods that might return several items.
    1 point
  4. So we have established that my suspicion was correct. You have a problem with a commercial product that we have no way of looking at. It does seem that this is related to an "attachment" processing addon, but I could also be wrong about that. Either way, without the actual source, or access to your server, there isn't some magical generic fix that is going to make things work. The stack dump you attached should be looked at in reverse. So the first item was the last method run. It was running the getEditorData() method in the Attachment class, and something the code is doing at around line 1752 triggered the exception. The message indicates that there is a "handler" architecture involved, and whatever is being read has the "post" content type, which is likely some internal classification of data inside the application/database. The code is expecting there to be a handler (ie. some code that will be able to figure out what to do next) and the forum software is not finding any handler that's been registered within the application to be able to process further, so it throws the exception and exits. This is why I suspect that the old forum might have been using some sort of plugin, and possibly your issue is that you don't have that plugin installed and configured with whatever Xenforo installation you have now. Also as I stated in my prior message, the forum version and PHP version you are running could very well be at the heart of the problem, as it's possible if you are running an older version of their forum software, that there are techniques and syntax that don't work anymore with a more current version of PHP, or as I surmised, there could also be a plugin missing. I don't think there's anything more I can suggest for you, other than to seek help on the xenforo and Xfrocks communities. I hope this helps you
    1 point
  5. One more thing that might help: It looks like it may be possible that the issue is related to the use of XFrocks, which is some sort of commercial addon to Xenforo.
    1 point
  6. Educated guess: Xenforo? From what I can see it's a commercial closed source product. It seems a day doesn't go by where I find out about some php based product I've never heard of, that has a business built around it. If my suspicion is correct, there is very little help anyone here can offer, as it is unlikely anyone has any experience with it. My best advice would be to find an experienced PHP dev, and probably one who has familiarity with Xenforo. Your best chance of finding such a person, whether it be free advice or someone you can pay to help you figure out your issue, is going to be on the Xenforo Community forums. As requinix already stated, if it is not xenforo, the first thing we need to know is what forum software you are using. Be candid and provide details if you want further help. Things like the os of the server, version of php, and version of the software being run are important.
    1 point
This leaderboard is set to New York/GMT-04:00
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.