I need to have this eloquent inserting data into my table with my first two columns, id, category_id be added with auto increment, specifically, the highest value + 1. my code above has the error: what can I at the “max()” for this to function as intended? any help would be appreciated thanks. Answer you have error in I think
Tag: laravel
How can I overwrite my file images in laravel
I would like to ask how can i overwrite/update my images inside the form and store in database? I tried doing it but it is not working, i get the id correct but when i upload new image and text, it is not updating my old file. Below i attached my code. company controller edit modal for company I might
Target class [DatabaseSeedersRoleTableSeeder] does not exist
So I’ve been creating a CMS with Laravel and when I run this command to migrate the tables I’ve been experiencing this error I’ve tried searching to see if someone has the same problem as me, but there seem to be no similar problems. I also can’t tell if the migrations went through or not. EDIT: Here is the seeder
Laravel, how to display Values in DB with just given IDs?
im trying to get 5 data from DB with their ID ? HTML Route Controller – im Trying to get Just 1 ID and its not Working I want to show 5 Offers from Offers Table, with given 5 ID in HTML Form ? How can i do this in Laravel ? Answer You never execute your query… where() is
How to display a record that has no relation to a table
What I need is to count the number of vehicles created by each user, but the problem is that when I make the query for the relationship, it only brings up the users who have vehicles created, but I also need to show the users who do not have vehicles created. what i get id name email vehicles 65 name1
Add Pagination to relationship and get the relationship’s relationship – Laravel
I am building a forum website using Laravel and Vue. I have three tables: forums, posts, and users. One forum can have multiple posts, each post has a user who created the post. When the user clicks on one forum, I want to display the latest 10 posts to this forum with the paginate method. Forum.php Post.php User.php Here I
print days of a special month ? laravel
I need to print only the records for the month of May I get them with the variable I need to see only May results, how do I do it? Answer You can use if condition or
Laravel : How to Create Dropdown to Select FOREIGN KEY from Other Table?
i want to ask you how to select FOREIGN KEY (from “doa_id in “doas” table) when user create a new data (to the “notes table) in a form. This is my code : NoteController.php 2021_05_28_020438_create_notes_table.php migration and this is my dropdown html : In Dropdown option, I want to show “doa_name” based on it’s “doa_id” Thank you 🙂 Answer You
Eloquent “where” on relationship returns wrong models
I have this method on my model “Employer”: I thought it would work fine, but it ends up giving me models that aren’t even related to my Model. Like, the id of the model is 37 and it gives me the relationships of all the models (like id 6). Any idea of why this would happen? Answer I think you
Add class on div using foreach if else Laravel
I have 5 items ( 3 items on first row & 2 items on 2nd row ) that loads something like this Here’s my sample blade code But what I’m trying to do is something like this By doing this I need to add a class named as ‘mid’ on this location Tried to use something like this But it