Weird path situation in Laravel. Why is this working? - laravel-5

I'm working on some Laravel code in PHPStorm and I just noticed a weird path problem. Looking at the project directory
it's obvious the path to my models is App\Models but if you look at the code, the path is App\Http\Models. If I change the code to use App\Model, PHPStorm complains that it can't find the model, and when I run the code I get the same error.
I've looked throughout my code and this is the case everywhere.
What's going on here?

Take a look at the namespace section in your model files.
It should point to
namespace App\Models
and not to
namespace App\Http\Models

Related

What is the difference between a file with .dist and without

I'm trying to learn more about package development by using Laravel Nova as a bit of a guide. I'm confused as to how Nova's assets are compiled, and part of that confusion stems from Nova not having a webpack.mix.js but instead a webpack.mix.js.dist.
I'm trying to model this within my package in order to compile and publish my assets for use in my project, but I get npm errors when trying to run any command
Cannot find module 'dir/dir/dir/package/webpack.mix'
I'm unsure as to why it is looking for this file in the first place, but it still seems to be an issue. To get to the root of why this is an issue and how I can fix this, I'd like to know what the difference between webpack.mix.js and webpack.mix.js.dist is.
Any feedback on this would be greatly appreciated. Thank you.
Files that end in '.dist' are generally the default distribution files that come from the package and should not be edited. They will be overwritten on package updates.
You can use them as a reference to add or replace configuration in your primary file(s).
From what I can gather, Laravel Nova creates it's real webpack.mix.js from this file when you activate a certain feature. (It's a paid product, I do not have a license to see it, I can only skim the documents.)

How to solve the following error in Laravel and How to know the File Path of SessionHandlerInterface?

I started working with Laravel. Faced a FatalErrorException:
Declaration of SessionHandlerInterface::1($save_path, $session_name) must be compatible with SessionHandlerInterface::1($maxlifetime)
in FileSessionHandler.php line 10
It was working yesterday, and as far as I remember, I have not updated anything.
I tried to look into file FileSessionHandler but I can't figure out the problem. I also tried to look for SessionHandlerInterface, but I am not able to find the Interface file.
How can I solve this problem?
Also please tell me the meaning of 1 after scope resolution operator.

Laravel 5.1 using phpstorm code completion issue

this question may have been asked, but i could not find it so far.
i'm new to laravel (5.1) and phpstorm (v9) and trying a simple controller with a view and route.
I noticed that while typing the code for example:
View::make('someView');
if i ignore the autocomplete (intellisense) and complete the code.
i get a "NotFoundHttpException in RouteCollection.php" error.
But if i apply the suggested autocomplete for example:
Illuminate\Support\Facades\View
it works fine.
May be i've missed some configurations on Laravel or phpstorm or both, may be this issue is in only phpstorm v9. Either ways it sometimes give me a headache, specially as i just started learning.
Btw, even if i've
use Illuminate\Support\Facades\View;
for ever function that i write i still have to apply the autocomplete suggestion.
else i get the same View not found error.
Please let me know if there is a way to fix this.
Thanx
Install barryvdh/laravel-ide-helper package and follow instructions. It will create helper files that will improve you IDE autocomplete for Laravel project.

phpDocumentor relative paths to css and javascript

It's my first time using phpDocumentor 2 and every file in the root folder of the documentation looks fine.
Unfortunately, anything in the subdirectories (classes, namespaces and packages) doesn't look right or function properly, because they don't reference "../css/template.css" but "css/template.css". (Same problem with the JS)
Am I missing some sort of configuration issue? The demo on the phpDoc site seems to include the reference to the parent directory.
Thanks in advance!
Probably not configuration... may just be a bug that's cropped up while working on the beta versions. Open an issue about it at github (https://github.com/phpDocumentor/phpDocumentor2).

using Microsoft.IdentityModel.Claims; fails in my Home controller!

I'm following the Microsoft guide for implementing federated identities. As it doesn't state where the code should be placed I created a file \App_Code\Auth.cs for it. when it's time to implement the FederationResult to my home controller I try to use the aforementioned namespace but VS complains of missing an assembly reference.
The weird thing is that the code in Auth.cs doesn't complain... I've looked in the References item of the project and don't see anything I can recognise, although I did "Add STS reference" to the project. I've also looked in NuGet but don't see anything I should add...
what's going on here?
hmm... seems I just needed to add the reference manually. I don't know how come the assembly is available to some pieces of the code and not to others but it works!
One more thing, I needed to use Microsoft.IdentityModel.Web not .Claims

Resources