I am new to Laravel and I was working on Laravel 4. I am trying to migrate to Laravel 6 on docker and I have the basic setup and Laravel project is up. I created a table and a respective Eloquent …
Tag: laravel
Laravel, Handling validation errors in the Controller
So i’m working on validating a form’s inputs using the following code: So basically, there are two fields in the form, a title and a body and they have the above rules. Now if the validation fails I want to catch the error directly in the controller and before being redirected to the view so that …
Laravel relationships and pivot tables
I’m working on my first ever laravel app, now I’m at the stage of creating some relationships for my content types. In the app I can create an appointment which in the process of doing so also saves …
Nginx Returns Welcome Page Inside Docker Using Laravel & Traefik
I’ve setup Docker with a custom Nginx/PHP image for my Laravel app. I’m serving it via Traefik as I’m hosting multiple sites on one machine. Nginx only returns the Welcome to Nginx page when I load up …
Laravel validate regex not allow kanji char
I want to validate a form input which not allow input kanji char using Laravel validate rule. How to do it? This is what I did: public function validationRules() { return [ ‘name’ => ‘…
How to set release limit while using php-deployer?
I am using PHP deployer 6.6.0 to deploy Laravel based websites. Every time I deploy it creates a new release. Currently, I have more than 10 releases and it’s eating up a lot of disk space. I don’t want to keep more than the last 3 releases and need the older releases to automatically roll over. H…
Pulling data into a select option in laravel
I am trying to pull data from a different table into a select tag where the user can choose which program a certain course belongs to. I am getting an error of syntax error, unexpected ‘}’, expecting ‘…
Convert Carbon date to html date time format
I have this format comes from Carbon // Y-m-d H:i $datetime = 2019-12-10 14:00; Now i want to convert this date time format to use it in datatime-local input. <input type="datetime-local" …
Laravel: Displaying data from db after clicking a button – but staying on the same page
That’s the task I am currently facing: Starting point: I have a form, which accepts data and saves it into the database. What needs to be done: I need to include a button called “show data” (a different one than the “submit” button in the form, it can even be a clickable div), wh…
Delete information from database using laravel 6.0 and function destroy doesnt work [closed]
I am trying to eliminate an event that I created before. I tried to use the function destroy() but it didn’t work. I think that the cause could be the route in the view <!–Here it is the code of …