A
A
Agent Gus2018-07-17 18:23:50
Laravel
Agent Gus, 2018-07-17 18:23:50

What is the name of this piece of code?

Hello, I started to study OOP in more detail. I delved into LARAVEL from the point of view of how it works.
And I came across that in functions, instead of a data type, they use this:
They use the Request class located in Illuminate\Http\Request, as I understand it.
What is it called to google? I want to understand how it works.

use Illuminate\Http\Request; (пространство имен)
class Far
{	
 --->        public function test (Request $request) {
    return $request;
  }
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Aksentiev, 2018-07-17
@yanminibaev

type hinting

A
Alexander Pushkarev, 2018-07-17
@AXP-dev

Read about: dependency injection Have
a look here: https://laravel.com/docs/5.6/container

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question