I would like to find a list of all models, database tables as a backup, in a Laravel project. I want to do this to build a dashboard that displays the way data in all of the models has changed over time, I.E. if there is a user model, how many users have been added or modified each day for
Tag: sql
How to execute raw queries with Laravel 5.1?
So I have this tiny query to run on my DB and it works fine in MySQL Workbench. Basically, a SELECT with LEFT JOIN and UNION with LEFT JOIN again. SELECT cards.id_card, cards.hash_card, …
Fetching all parents in simple way with PostgreSQL
I have a table with a hierarchical structure: I want to list all parents of the plan name Paints, so I can build a breadcrumb to navigate back. Using id = 6 I like to get: I’m using postgresql with PHP, and thinking of efficient way to fetch all the parents as simple as possible. Answer Use recursive with query:
PHP Dropdown Box from SQL Join
I want to do is have a dropdown box that will display the MealOption and when that is selected somehow find that products meal id? This is my database layout
PHP executes but doesnt execute SQL update correctly
I have a table which displays -Staff ID (Primary Key) -Staff Name -Staff Position All the data loads in to my grid, the grid has an update button witch should let me to update it but it returns …
Broken links after moving wordpress site
I moved my wordpress site from local host to a live server. The problem is that all links from my nav won’t work as the home button. live site url: http://iulian.cablevision.ro broken link example: http://iulian.cablevision.ro/about/ this is the error that i get: I tried to use the a comand in SQL on my database to update urls: And I also
assigning variables to sql query result
Amateur here, just practicing some sql. I am trying to assign php variables to my sql query results, and I thought I saw it work in this fashion, but it doesn’t seem to be working for me: $query1 = …
Laravel seeder gives error. Class not found
I’m a newbie in Laravel and and I’m teaching myself how to authenticate from a login table. I have migrated and created the table. Now, I’m trying to seed the data into the login table, but the …
MySQL show all rows and sum at the end
I’ve read through about 20 different answers regarding this question, but either I’m mis-understanding the answers, or its just not clicking. Here is my situation: I have a table that lists ingredients for a recipe. Columns in the table are: ingredient_id, ingredient_title, ingredient_oz, ingredient_grams, ingredient_lbs (pounds), etc. I want to list each ingredient, then after all ingredients have been listed,
Laravel: getting a single value from a MySQL query
I’m trying get a single value from MySQL database using laravel but the problem I’m getting an array . this is my query result in MySQL command line: my laravel function: expected $data value is a string with value= Admin but what i get is : [{“groupName”:”Admin”}] Answer Edit: Sorry i forgot about pluck() as many have commented : Easiest