Support the ongoing development of Laravel.io →
Architecture
Last updated 2 years ago.
0

Hi RMFogarty, That because when you are in specific namespace, here App\Http\Controllers, you can access directly on elements on others namespaces. If you want ton access on Validator, Lang ect you have to prefix it by . \ is the root namespace.

To remove the \ you can just include it with the use at the top of your class like the next example:


<?php namespace App\Http\Controllers;

use \Validator, \Redirect, \Request;

class WelcomeController extends Controller {
Validator::make();
Redirect::back();
Request::all();
Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

RMFogarty rmfogarty Joined 5 Jan 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.