Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

Make sure that App\User exists #579

Open
fasi1208 opened this issue Mar 7, 2021 · 1 comment
Open

Make sure that App\User exists #579

fasi1208 opened this issue Mar 7, 2021 · 1 comment

Comments

@fasi1208
Copy link

fasi1208 commented Mar 7, 2021

Under installation steps. In point 3

Step 3. Check if App\User exists

If I navigate to this link it shows

`<?php

namespace App;

class User extends Models\User {
//leave this empty
}`

I have few questions

  1. What to write inside the class?
  2. If it is supposed to be empty then what is the point of creating it?
  3. How to create a user?
@matiaslauriti
Copy link

matiaslauriti commented Apr 12, 2021

I am new here and I was helping a user with the same problem on SO.

The idea is that this package still uses the old Laravel model's pattern (have models in app instead of app\models) but this changed on Laravel 8 by default. So for this package to work (because it is doing use App\User; where it needs it) you have to have that class autoloaded/available, hence if you have your model on App\Models\User, you can "alias" it by creating a class that extends the original but is also available as App\User.

That is why it is empty, it is just an alias... This is one file that uses this:

use App\User;


So:

  1. Write nothing, copy paste what is in the example.
  2. This is just an alias for autoloading.
  3. You still use App\Models\User for anything else.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants