Tag Archives: laravel database


Working with form in laravel

Hello World, Welcome to this website. Today i am going to create a tutorial in which we will create form and submit form data in database with validation in laravel. In my recent tutorials, I am creating a blog application.In this tutorial, i will implement the add comment section in this blog application. so lets start to working with form in laravel.

I have divided this tutorial in following steps,

  • Create Add Comment form in post detail page
  • Setup Route to submit the comment form
  • Setup Post Controller to submit form and save data in database
  • Run the project

Continue reading

Model Relationhsip in Laravel

Hello World, Today i am going to discuss model relationship in laravel. We will extends our previous tutorial in which we fetch data from database with ajax in laravel. In previous tutorial, We are fetching posts from database. In this tutorial, We will add comments in database to specific post and then fetch specific post comments with One to Many Relationship.

I have divided this tutorial in following steps:

  • About model relationship
  • About eloquent ORM
  • One to Many Relationship
  • Define comment model
  • Define One to Many¬†relationship
  • Fetch specific post comments with model relationship in post controller
  • Create post detail blade template
  • Add some dummy comments with laravel factory
  • Run the project

Continue reading


Add data in database in laravel

Hello World, Welcome to my website. Today we will discuss about how we can add data in database in laravel. In the previous tutorial, we have discussed about how we can implement form validation in laravel.

In this tutorial, we will extends the previous article. In this article, we will learn how can connect database with laravel add how we can add data in database.  I have devided this tutorial in following steps.

  • Setup controller for adding data
  • Show success message in add form

Continue reading