FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

change fullname to name by ezhasyafaat · Pull Request #16 · leafsphp/leafAPI · GitHub

This repository was archived by the owner on Oct 8, 2024. It is now read-only.
/ leafAPI Public archive

change fullname to name - #16

Merged
mychidarko merged 4 commits into
leafsphp:v3.xfrom
ezhasyafaat:v3.x
Mar 6, 2022
Merged

change fullname to name#16
mychidarko merged 4 commits into
leafsphp:v3.xfrom
ezhasyafaat:v3.x

Conversation

ezhasyafaat commented Mar 3, 2022
edited
Loading

Copy link
Copy Markdown
Contributor

Description

Change key fullname on scheme/user.json to name

Related Issue

I found some error when i was try to create user from API, its because in scheme/user.json use key "fullname", but in model search for column "name"

Change $console->resgiter default to array
ezhasyafaat closed this Mar 3, 2022

Copy link
Copy Markdown
Member

@ezhasyafaat I'll check out the issue if it still stands

Copy link
Copy Markdown
Contributor Author

okay, in my local project i have fixed this issue, but i close the PR because i have PR to master

ezhasyafaat reopened this Mar 4, 2022

Copy link
Copy Markdown
Contributor Author

can you check this again @mychidarko?

mychidarko self-requested a review March 5, 2022 21:01

mychidarko left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Hey @ezhasyafaat finally got the chance to look through the issue. Actually both schema and migrations use fullname, so those can be left unchanged. The only change needed here is on the User model. You can edit the $fillable field to fullname there.

Like this:

protected $fillable = [
    'fullname', 'email', 'password',
];

Copy link
Copy Markdown
Contributor Author

in my local project i try to just change the model user, but i found error again Leaf\Exceptions\ErrorException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'name& (truncated...)

ezhasyafaat commented Mar 6, 2022
edited
Loading

Copy link
Copy Markdown
Contributor Author

so i think we have to change scaffold auth in repo aloe, what do you think? @mychidarko

Copy link
Copy Markdown
Member

What do you have in mind?

Copy link
Copy Markdown
Contributor Author

In ApiAuth/controller/Auth/RegisterController.php, weh have to change

$credentials = request()->get(['username', 'name', 'email', 'password']);

        $validation = Form::validate([
            'name' => 'required',
            'username' => ['username', 'max:15'],
            'email' => 'email',
            'password' => 'min:8'
        ]);

to

$credentials = request()->get(['username', 'fullname', 'email', 'password']);

       $validation = Form::validate([
           'fullname' => 'required',
           'username' => ['username', 'max:15'],
           'email' => 'email',
           'password' => 'min:8'
       ]);

Copy link
Copy Markdown
Contributor Author

i can do it this in this repo

protected $fillable = [
    'fullname', 'email', 'password',
];

and i can do it this in aloe repo

$credentials = request()->get(['username', 'fullname', 'email', 'password']);

$validation = Form::validate([
   'fullname' => 'required',
   'username' => ['username', 'max:15'],
   'email' => 'email',
   'password' => 'min:8'
]);

Copy link
Copy Markdown
Member

Oh yeah, right. In the controller as well

Copy link
Copy Markdown
Contributor Author

okay i will fix it now

mychidarko merged commit 0a6888e into leafsphp:v3.x Mar 6, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL