I want to separate my validator with my controller, but API always responds with a 200 OK in Postman. Request validation: class PostRequest extends FormRequest { use Types; public function …
Tag: php
How to configure `.env` file in Laravel for sending mail?
Getting error while sending mail from a in Laravel website. local.ERROR: Connection could not be established with host smtp.gmail.com [A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to …
Regex letters are not allowed when they should be?
My and my group are trying to create a simple PHP code editor that also executes the code without the use of a library. We know the risks that come with eval(), but since it’s all running on a local server it shouldn’t be a problem. The Regex part is definitely the problem since we have no clue ho…
Laravel Validation- depends on the value of another input field
I have 2 fields status and releaseYear and productionYear. I have to put the validation that : $request-> ‘productionYear’ => ‘nullable|digits:4’, ‘releaseYear’ => ‘required|…
How to use “If else” condition with date in blade template
Hi guys so I have post and comment system, So I want to show comment section if the day of the post +7 days. if they see the post on day 8 of the post created they can’t comment. Here is my code that I try but I still dont get it : I know it’s totally a dumb code,
Spatie/Newsletter: MailChimp Invalid MailChimp API key “ supplied in Laravel 5.6
Good morning all of you, I’m currently working on using spatie/newsletter in my laravel 5.6 Blog to work with MailChimp to create a newsletter where users can subscribe. When I try to subscribe, I get this response: My Controller Env File newsletter.php (after running php artisan vendor:publish -provide…
Limit Comment in Post Laravel
So this is the problem, I have application with post and comment. But I want to limit the comment per user, So if there is 1 post only 1 comment per user. Is it possible ? Here is my store function in CommentController: What query can I add in this store function to limit the user to only comment once
Substract an amount of time to an addition of times
I have to substract 32:30:00 (string) to 95:05:00 (string) in php : THey are coming from an addition of time . I can’t find any code working, cause strtotime doesnt accept more than 24 as a value . Please help me, thank you. For example, i ve tried this : It returns 0 It should return something like 62:…
PHP not returning Ajax Call
I’m trying to send over the data from my textarea using an ajax call to my PHP file, but we aren’t getting any response back from the PHP file. — # Answer # — I thought I had already tried an echo in this piece of code, but I think I just missed the output on the webpage and thought
Change item of a session array in Laravel
I’m using Laravel 5.6, using session array to store the user details after login. user_date = array:19 [ “userEmail” => “user@user.com” “username” => “userwebtest” “role” => “user” “…