Skip to content
Advertisement

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

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

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

Advertisement