Clement_Te started a new conversation Envoyer: Work With Base Directory / Subfolder In Repository
I have a repository where the Laravel backend app lives in a subdirectory called server. I am trying to figure out how to tell Envoyer that the composer commands should be run in this directory or if we can even tell Envoyer to checkout this folder only? Or should I find a way to work with the hooks (new symbolic link or something)?
Thank you for your help!
You can customize the notifications template. Have a look here: https://laravel.com/docs/5.5/notifications#customizing-the-templates
If the relationship fails, you would not be able to call
->name on it which would throw an error. Your snippet should work according to me.
Can you maybe provide us with the migrations and your dataset?
Clement_Te left a reply on Use Vuejs In Blade Template To Conditionnally Show Block
Thank you for your answer @aurawindsurfing
The form's purpose is to create/edit a user profile. The data I need to pass to the component is therefore from a Eloquent model. I obviously have to avoid Laravel Collective inside the component. But would you see this as passing props to the component (the model, the errors bag and the arrays for the dropdowns), cause that seems a bit rough.
Or would there be a way to somehow keep my template in blade surrounded by my component which would have
<slot></slot> in its template. But there I would still have to set props or the data method, right?
Thank you for your help.
Clement_Te started a new conversation Use Vuejs In Blade Template To Conditionnally Show Block
I have a Laravel app in which I'd like to introduce a bit of Vuejs to do some conditionnal templating in forms (show extra input fields depending on dropdown values, this type of stuff).
At first, I thought I could simply init a vue app and use
v-if in my blade but I realize I need to specify the
data() method with default values.
What would be best practices for my need if I don't want to use Vanilla or jQuery? My main concern is that my form can get quite big and I use Laravel Collective forms and handle form validations on the service-side with the errors bags.
<slot></slot>and pass data as props and I should still be able to display the errors using blade?
Thank you for your advice. Good day
I am trying to perform a request where I have the following models:
I want to be able, from the Order model, to fetch all the unique products (present in the sub-orders) with the summed quantity for each.
The request I am expecting is something like:
select products.*, sum(quantity), categories.* from products join consumer_orders_products on consumer_orders_products.product_id=products.id join consumer_orders on consumer_orders.id=consumer_orders_products.consumer_order_id and consumer_orders.order_id = $this->id join categories on categories.id=products.category_id group by consumer_orders_products.product_id
What would be the best way to perform this from the Order model with Eloquent?
Thank you for your help.
After digging a little more, I realized the event is called only on the first setUp for the first test case. The set up is rightly called 3 times, once for each case, but the event only once while each test seems to be clearly tore down (database cleaned).
Thank you for your reply. Although, I put a var_dump in this method and I can see it is already called.
Any idea? I will try by calling it manually and let you know.
Here is the model : https://github.com/ctessier/budgeck/blob/unit-tests/app/Models/AccountBudget.php
Hope this helps. Thank you
I am facing a weird behavior while writing unit tests for my app. Basically, I have a model, that when it is created (saved into the database), a function is called that create and save another model in the database as well.
I do this using the events in Laravel 5.1 : https://laravel.com/docs/5.1/eloquent#events
Although, when unit testing, I create the model in the setUp(), the method is called as the event calls it but no new data is added to the database (while the first model correctly is).
I hope I was able to explain my issue properly.
Is there anything that I would not be aware of while unit testing?
Thank you in advance for your help. Kind regards,