Skip to content
Advertisement

Tag: laravel

Laravel Multilayered groupBy

Assume we have this record: While assuming we have this code in our DummyController: And lastly, assuming we have @foreach ($dummyRecord as $dummy_column_name => $dummy) inside our index.blade, we could display the result as such: But I want to display the relation 4’s record of color as a div inside a div, which makes the final output look like this

Laravel filter relationship data

Code Data return Question: I tried to filtering data that if a relationship “getCauserDetails”, How can I not show the data if the relationship name is only found “test” or should I say null? So on the example output, it displays all the data, but I want to only the data that I filter just retrieve. Answer Because of your

how to modify user table

I would like to add two fields to the table user. the first name and a key. on RegisterController On user model table migration I have no errors, but the registration does not go to the database and I stay on the registration page Answer Remove this line ‘cle’ => [‘required’, ‘string’, ‘unique:users’], from your validator() method, as you’re generating

Laravel Duplicate Route names

I’m using same route name for the get & post methods in route. those routes are using for the same purpose. ex : I’m calling to load add view form using get route Route::get(‘add’, ‘UserController@addView’)->name(‘user.add’); then, I’m calling to store data in that form using post route Route::post(‘add’, ‘UserController@store’)->name(‘user.add’); is there any issue , If I use the same route

How to save data to db using laravel import?

I have prepared code below, and I’m using the dump to trace if it passed to models’ create function. When I checked in the database there is no data added, I’m just wondering why it does not have when it is already passed in User::create function (verified by string “created” below in the picture). These are the dump datas returned

Advertisement