OctopyID/OctopyFramework

There is no App\DB\Repository

cloudssd opened this issue · 1 comments

Describe the bug
There is no App\DB\Repository

To Reproduce
Steps to reproduce the behavior:
Just use the documentation for showing a user id.
UserController@sow as described on documentation

Additional context

How do I view the user since there is no App\DB\Repository and I cannot show the user info from database
Also if I use Octopy\Database\Model; I get the folowing

return User::where('id', $id)->first(); gives me : 500 - Error: Call to a member function query() on null

return User::find($id); gives me 500 - Error: Call to undefined method Octopy\Database::find()

the model is User model in Http\DB
namespace App\DB;
use Octopy\Database\Model;
class User extends Model

and in UserController is:
use App\DB\User;
return User::find($id); or User::where ...

Hi,

php octopy make:model User

I assume the User model is with the users table (if different, please change the table name in the 'table' property of the model).

and the model is located in app/DB/User.php

To do a first query,

$user = User::where('id', 1)->first();

echo $user->name;

For the find or findOrFail methods like Laravel right now, it is not possible because the method is not yet available in the current version.

Regarding the Repository you mean, I don't understand yet, can you attach the source code?