markdown 在Laravel 5.5中了解有关模型和视图的更多信息

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 在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](https://www.cloudways.com/blog/models-views-laravel/)

以上是关于markdown 在Laravel 5.5中了解有关模型和视图的更多信息的主要内容,如果未能解决你的问题,请参考以下文章

如何修复 laravel 5.5 中的查询生成器错误 sql 注入 *

震惊,这篇文章竟然因为色情原因被删除 | laravel 5.5 相对 5.1 中的变动

如何在 Laravel 框架中降级? (5.6 至 5.5)

Laravel 5.5 中的多字段排序

在 Laravel 5.5 中测试授权策略时遇到问题

如何在 Vue 2 和 Laravel 5.5 中验证会话和身份验证令牌