3/9/2018 - 2:06 PM

Learn more about Models and View in Laravel 5.5

Learn more about Models and View in Laravel 5.5

In Laravel, models are created inside the app folder. Models are mostly used to interact with the database using Eloquent ORM. Eloquent provides simple ActiveRecord implementations for database interaction.

The easiest way to create a model is the Artisan command:

php artisan make:model <model name>

Views in Laravel are created in the resources/views folder. You can change base path for views by editing config/view.php file and changing realpath(base_path('resources/views')) to the new location for the views.

Laravel offers a simple view that routes to home. Loading a view in the controller is easy. You just need to add view(‘viewname’) method while returning from the controller method.

public function index()
    return view('home');

Read full article at: Working with and Creating Model and View in Laravel 5.5