DEV Community

Md Abdullah al noor
Md Abdullah al noor

Posted on

how does keyword 'use ' works in php (laravel)

I don't understand how does use keyword works in laravel framework

I create a controller PostsManagerController.php

this controller has a namespace App\Http\Controllers;

until here everything is fine the problem is in routes/web.php

i find this two lines

use App\Http\Controllers\PostsManagerController
use Illuminate\Support\Facades\Route;

my question is how routes/web.php know the PostsManagerController class…

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay