I am trying to implement pagination in laravel and got following error Here is my controller function Here is the Tag Model The Tag and Post model has belongsToMany Relationship so there are many posts under the specific tag and my aim is to iterate all posts under the specific tags descending order of post a…
Tag: laravel
Default hash type of passwords in Laravel
What type of hashing algorithm is used by default for passwords in Laravel. If we want to change the password in the database then how can we identify the hash type of the password? Answer According to Laravel Documentation : The Laravel Hash facade provides secure Bcrypt hashing for storing user passwords. I…
laravel carbon get day names from a date column from a collection
I have this collection from a database where I have a column called “event_date”. What I want is just to get only the day names from that column that comes in a collection. I know you can use Carbon to get the name days through, for example, a method called ->format(), however I get an error sa…
Laravel custom db driver
i know there is a nice way of defining connections via app/config/database.php . But i don’t think there is a driver for me available. Imagine my db is read from file, like a txt. (Yeah! that’s my client db, sort of). So in that file, before I i need a real driver! Currently it uses a txt base db …
How to create a password reset method in Laravel when using the Database User Provider
I’ve been searching the internet and have yet to find a solution to the following problem… We currently have a website developed using Laravel which the user table is a remote Microsoft SQL database. The driver in config/auth.php has been set to “database”. All is working fine except f…
What is the best practice for adding constants in laravel? (Long List)
I am rather new to laravel. I have a basic question, What is the best way to add constants in laravel. I know the .env method that we use to add the constants. Also I have made one constants file to use them for my project. For example: And so on. It can reach upto 100 or more records. So
How to update cart options in LaraveShoppingcart by Crinsane
I’m using laravel cart by Crinsane https://github.com/Crinsane/LaravelShoppingcart I wanna update options cart, I have many options inside, but I just want only one option to change, and I cannot do it Here’s my code and then I want to change options Here’s my code and then the result option…
How to sync multiple values of the same Attribute in Laravel?
I developing an eCommerce ( with Multiple Product Attributes feature ) website using Laravel 5.4. Everything is working fine. But When I try to sync multiple values of the same Attribute in Pivot table. Laravel ignores the duplicate pares. For example, I’ve an Attribute called “Network” whic…
Laravel Dusk – Class config does not exist
recently upgraded a 5.3 project to 5.4 and all seemed good. Today I started to implement Dusk however had hit an issue when running the example test I’ve had a look at line 40 of TestCase.php and its So it does look like something to do with the global config helper anybody have any ideas? I’m run…
How to save uploaded image to Storage in laravel?
I am using Image intervention to save an image to the storage folder. I have the code below and it seems to just save a file name with a blank image. I think I need a way for the file contents to be written to the folder but struggling for the snippet. Answer You need to do