Laravel View Component support on view namespace - laravel

By default you can add components to resources/views/components and use them using x- prefix with blade files. I registerd a view namespace which is located on different directory and i want the components directory in that namespace to be discovered as well.
Is there a way on laravel 7 to add additional directory to discover?

The instructions for Manually Registering Package Components in the official component documentation at https://laravel.com/docs/master/blade#components should give you the functionality you are after by registering your components manually in a service provider.
That said, it might be worth thinking carefully about why you want to deviate from the default folder.
I hope this helps!

Related

is it important to use the same directories for views and models

is it important to use the same directories for views controllers and models or you can be free to create files inside created folders and refer to them when needed
in Laravel MVC
Check docs Directory Structure
The default Laravel application structure is intended to provide a great starting point for both large and small applications. But you are free to organize your application however you like. Laravel imposes almost no restrictions on where any given class is located - as long as Composer can autoload the class.
I myself haven't tried doing my own folder structure. I would personally stick with the standard created by Laravel and follow that.

REST API versioning in Laravel

I wanted to make versioning like a domain. So inside app directory i want to move all folders into v1, v2, etc. So it will be App\v1, App\v2 namespaces. I need an advice, how to re-write bootstrap/app.php file, to instruct laravel to load only providers needed for the particular version. Where to put admin panel ? Thanks for answer.
Don't modify the bootstrap classes, instead go with this structure for API:
App
Http
Api
V1
-ApiController.php
Controllerphp
OtherWebController.php

Where is the Registrar Services in Laravel 5?

I added couple of fields to my user table and everywhere I read it said I also need to update the new fields in the app/Services/Registrar.php file. But I cannot find the Services folder anywhere! This is a new installation in Laravel 5 and here is the screen shot of my directory structure:
What happened to the Services Folder? When I test, I can see that the User::create() works but I dont know where its declared since I cant find the Registrar.php file.
I added couple of fields to my user table and everywhere I read it said I also need to update the new fields in the app/Services/Registrar.php file.
This was removed in Laravel 5.1.
https://laravel.com/docs/5.1/upgrade#upgrade-5.1.0
Secondly, the App\Services\Registrar class used in Laravel 5.0 is no longer needed. You can simply copy and paste your validator and create method from this class directly into your AuthController. No other changes should need to be made to these methods; however, you should be sure to import the Validator facade and your User model at the top of your AuthController.
You are using 5.1 version and it doesn't have such directory or service. This version uses AuthenticatesAndRegistersUsers traits for registering users.

base controller zend framework 2

I wonder if someone here can help, I am just starting with Zend Framework 2 and I am find it slightly daunting to get a project started off properly..
I am trying to create a base controller that I can be extended from. I am currently using the Zend Framework 2 skeleton application.
I have created a Resources folder in vendor/zendframework/zendframework/library. Within the the Resources folder, I have a Controllers folder which houses a BaseController.php file.
How do I get my project to autoload the BaseController in the Resources folder for it to be available through out the entire site?
Any help will be most appreciated.
Thanks
You shouldn't need to create a base controller, ZF2 already provides a number of base controllers for you, such as the RestController and the AbstractActionController
http://framework.zend.com/manual/2.0/en/modules/zend.mvc.controllers.html
If you are going to create a base controller, create you own module and put it in the vendors directory.
You should never need to go into third party modules and modify code as you should be able to inherit and extend the classes that are provided by such libraries

How to get reference for namespace Microsoft.WebPages.Compilation

I am developing MVC 3 web application. According to some articles, we can register global namespaces by CodeGeneratorSettings.AddGlobalImport function.Here is one link.
But the problem is I can not use CodeGeneratorSettings class in my app, can not find any references for it. Have it already been depreciated?
I have Webmatrix 1.0 installed, but it does not help.
Any help is appreicated.
The method has been moved to the following namespace
System.Web.WebPages.Razor.WebCodeRazorHost.AddGlobalImport("Your namespace");
I would recommend using the web.config method however as there would only be one place in your code to add/remove namespaces.

Resources