Closed mudassirali007 closed 2 years ago
It looks like you're using the raw internal FileMaker record ID instead of regular model queries. You don't get a model back when you use the raw queries like that, so I don't think save() is going to work since there is no model to save. I would recommend using models for your data instead of raw queries. Can you give that a try? I think you'll have much more success that way.
so what about file upload?
I'm not sure what your Layout class is there. It's not from this package, so I'm guessing this is something you've made custom. I don't know what it is returning or what you're doing with it, and so I can't provide any help with that. You're also using the findRecordByID and the internal FileMaker IDs, so you're not using eloquent models with your primary keys and are instead using the raw query builder and getting raw data back, again, not in the way you should probably be doing it which was the same issue in your last post.
If you're using the raw query builder you use the saveContainer
method to write a container field, but again, I don't recommend using the raw query builder unless you can't use a model for some reason.
If you're using a model class it's easy to set a file and then call the save method, but looks like you have your own implementation of save() there, so I don't know what you're doing in that method.
If you're querying and getting a model to retrieve the internal, hidden FileMaker ID you shouldn't need to use the findByRecordID method since you already have a model object, so again, I don't think you're approaching this the right way and shouldn't be building your own methods for all of this behavior.
I would do this like this:
(assuming you have a model named Product
and a container field named image
)
$product = Product::find($id);
$product->image = new File(storage_path('test.png'));
$product->save();
I am facing two issue, like your help
I am using this syntax in laravel 8 and filemaker 19 to upload file
and getting this error
updating a portal data value which is an array
$product->InventoryTransactions[0]['InventoryTransactions::Units'] = 3;
and getting this errorPS: portal data is an array format