I am working with Laravel data querying and I need a query that is going to group all the children of a parent when I take the categories. the categories table has a name and a parent_id, the routes of the categories have the parent_id set as null, the query should return every category grouped by parent id a…
Tag: laravel
PHP Laravel Nova returns 404
I’m working on a local laravel-nova project which worked fine the last couple of days. Now all of a sudden, when I try to go to the /nova route I get a 404 error saying Page could not be found. I tried with but with no luck. I even deleted the vendor-folder and ran composer install and php artisan nova:…
How to use required_if on file array fields with an array for first argument?
I have an with an array of image_file (image_file[1], image_file[2]). They are input of type file. This images are required only if another array of fields (proposition_type) is defined on 2. For example : if proposition_type[1] == 2, image_file[1] has to be filled ; if proposition_type[2] == 1, image_file[2]…
Laravel pagination problem one by one pages
I’m sorry, I have a problem with my laravel pagination Gives me one by one page for example, in my table 16 row I make paginate (10), the pagination gives me in the first page from 1 to 10 and in the …
laravel seeds unique column ignore duplicate entries
i have a Seeder in Laravel in this email is unique, when I run first time its entering records into the database, when I run again its showing duplicate entry. do i have option to ignore that.? Answer We have an option to check whether the given email exists in the table or not.
How to get the username through an id in Laravel?
I am trying to create an offers forum, where some user can create their offers in order to provide their services and I want to show the name of the person that created that offer instead of the id. In my database I have the two tables: Offers table: User table: In offers I have a column of the professor_id,
Laravel excel maatwebsite 3.1 import, date column in excel cell returns as unknown format number. How to solve this?
By using Maatwebsite/Laravel-Excel version 3.1 to import excel sheet, here I faced an issue date time column of the excel sheet returns unknown number. How to solve this? Example : Consider Cell value …
Laravel Auth Login Page Just Refreshes
I am using Laravel 5.4. I ran the make:auth command to scaffold out my auth controllers and views. I can register a new account without issue as it is showing up in my database. However when I try to login, the login page simply refreshes without any errors being thrown. In the login controller I have the red…
Laravel 5.7: A facade root has not been set
I’m trying to get sitewide global settings from the database and use those settings in my controllers. In order to do this I’ve created a custom global.php file under config directory. Defined key=>…
composer global require laravel/installer
I’ve tried the first commands from the Laravel documentation composer global require laravel/installer I got error Changed current directory to /Users/bheng/.composer …