I’m new to the Laravel framework and I could need a little help from you. Could someone help me to convert this request into Eloquent ? SELECT * FROM `non_working_days` WHERE YEAR(date) = “2021&…
Tag: laravel
Container cannot see the prebuilt vendor folder in it
My project is throwing the next error after restarting the docker container: Warning: require(/var/www/ /var/www/ /vendor/composer/./symfony/polyfill-php80/bootstrap.php): Failed to open stream: No such file or directory in ‘vendor/composer/autoload_real.php line 71 My Dockerfile: My docker-compose: Inside container run ls vendor/symfony before restarting the container: And after: The error is solving if remove the vendor directory and run composer install. I’m not a
Trying to get property ‘approval_code’ of non-object
I’m trying to build a task scheduler for sending email routine and i got this error when i try to get approval_code from auth. Here are my code in mail: <?php namespace AppMail; use Illuminate…
Mail Not Sending via Mailgun API Laravel 8
I am trying to send mail via the mailgun API from my controller but the mail is not reaching mailgun and I am not getting any error messages/logs. This is in my .env: This is in my services.php: This is in my mail.php: This is how I am sending the mail in my controller: This is working when I send
How to get Date & Time from Database table column in laravel?
I’m trying to store and get current date & time from Database. I’m trying this $current_time = Carbon::now(); ‘order_date_and_time’ => $current_time, ‘delevery_date_and_time’ => …
Remove duplication from big table with laravel [closed]
I have a table with 5 millions records and it has duplicated rows I want to remove the duplication. This is my code $userRoles = Model::groupBy(‘phone’,’user_id’,’name’)->get(); $userRolesId = …
InvalidArgumentException when creating model through artisan
I am new to Laravel and is encountering a problem when I start a new laravel project. My current environment is: PHP 7.4.14 on Linux (Manjaro) & Composer 2.0.9. I use the following command to initialize a laravel project: Then I switch to the directory of lara and type: And then, I got an InvalidArgumentException: Model name contains invalid characters.
Laravel get data by time
I need to get data that has been created from 10 minutes ago till now but it returns wrong results $progresses return data with time stamp of 2021-02-07T09:15:44.000000Z while this data is belong to 8 hours ago. Strange thing is that in my database I don’t even have such timestamp! Answer Do not use from ‘where’ in here, use from
How can I get my custom gate working in Laravel?
I am trying to create a custom gate that allows users of the “Administrator” team to access the Users index page. However, it functions exactly the opposite of what I want to achieve and I …
Read first record of array instead of first character in Laravel
I’m using Laravel 8 . I’ve saved some array in my database and when I try to read those arrays I just get a single character of it. For example the array in database is [“one”, “two”] and when i write it will just show ‘[‘ instead of ‘one’ in my migration file i did this : and also in