D
D
Denis Bukreev2017-04-20 21:31:16
Laravel
Denis Bukreev, 2017-04-20 21:31:16

Where to write Fluent class code in Laravel?

So it goes.
There is documentation , and this section talks about Fluent.
And stupidly inserting code that is not clear at all where to write, where to use.
Damn documentation.
Where to prescribe all these pieces of code?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
Konstantin B., 2017-04-20
@denisbookreev

The fluent interface is a chain of methods in php and is used to more conveniently write requests to php, which is then used.
That is, instead we write it in the form'SELECT name FROM table WHERE 1 = 1'

DB::table('table')->select('name')->where('1', '=', 1);

It can be written anywhere. In fact, Eloquent models represent this very fluid interface.
And most importantly, Fluent is not a class. Fluent is an interface

P
pantagruel964, 2017-04-20
@pantagruel964

This is not documentation. Open the real documentation.

V
Vasily Nazarov, 2017-04-21
@vnaz

I'm not a telepath, but it looks like you're going the wrong way.
Look at https://laravel.ru/docs/v5/eloquent

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question