Comments (18)
The 'Sign Up' link goes to 'user/create' on a recently cloned install - perhaps this was fixed since you cloned the repo...
The 'Missing argument 1 for UserController::postIndex()' still happens though when signing up. In app/controllers/user/UserController.php, the postIndex() method expects $user as a parameter. It looks like it was done this way to allow a user to 'Edit your settings' ( /user ) where a user can update their settings.** Here it makes sense to pass in a user object to update.
However, when signing up, no user exists yet and a user object can not be passed in to the method - hence the error. The fix involves changing lines 24, 25 of app/controllers/user/UserController from:
public function postIndex($user)
{
to:
public function postIndex($user=null)
{
$user = ($user == null ? new User() : $user);
Hope that helps :)
**As a side issue, there is no link to 'Edit your settings' for a user who is logged in. Clicking on 'Logged in as username' in the nav bar brings the user to /user/settings which just displays user settings but doesn't allow them to be edited...
from laravel-4-bootstrap-starter-site.
Yeah I am working on a fix for that now
from laravel-4-bootstrap-starter-site.
http://example.org/user/create Works as it should for me. What create account link goes to /user?
from laravel-4-bootstrap-starter-site.
Hi Andrew, I just did a fresh install and the big blue button [Create new
account] on this page /user/create, still goes to /user and shows an error.
Want me to try fix and push the update?
Cheers,
Chris De David
On 11 May 2013 05:03, Andrew [email protected] wrote:
http://example.org/user/create Works as it should for me. What create
account link goes to /user?—
Reply to this email directly or view it on GitHubhttps://github.com//issues/65#issuecomment-17738615
.
from laravel-4-bootstrap-starter-site.
The create form should post to user
The edit user page should post to user/{id}/edit
from laravel-4-bootstrap-starter-site.
and sure if you have a fix I'd be welcome to see it :)
On Sun, May 12, 2013 at 10:54 PM, Chris De David
[email protected]:
Hi Andrew, I just did a fresh install and the big blue button [Create new
account] on this page /user/create, still goes to /user and shows an
error.Want me to try fix and push the update?
Cheers,
Chris De David
Phone: +61 (0) 3 5294 0297 | Mobile: +61 (0) 419 571 596 | Skype:
chris.dedavid
Mindflow.com.auOn 11 May 2013 05:03, Andrew [email protected] wrote:
http://example.org/user/create Works as it should for me. What create
account link goes to /user?—
Reply to this email directly or view it on GitHub<
https://github.com/andrew13/Laravel-4-Bootstrap-Starter-Site/issues/65#issuecomment-17738615>.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/65#issuecomment-17793887
.
from laravel-4-bootstrap-starter-site.
Removed; github not liking email replies from gmail. Format is compressed :-/
from laravel-4-bootstrap-starter-site.
Yeah that's a mistake. Should be something more like: 1565da0
from laravel-4-bootstrap-starter-site.
Fixing the other piece 19684e3
from laravel-4-bootstrap-starter-site.
I'll be merging that branch in shortly
from laravel-4-bootstrap-starter-site.
Andrew,
This fixed the issue: I removed the requirement of ($user) as a parameter.
Then created User object manually.
What happens then, it jumps to the login page, without any messages to say
that it worked or didn't work. I'll be updating that later.
It also sends an email, so I know it worked. Confirming the email and login
works from there.
Added some validation stuff,... trying to get messages back to form.
Code with Validation
/**
* Stores new user
*
*/
public function postIndex()
{
// Validate
$rules = array(
'username' => array('required', 'min:5'),
'email' => array('email', 'min:5'),
'password' => array('required', 'min:5'),
'password_confirmation' => array('same:password', 'min:5'),
);
$validator = Validator::make(Input::all(), $rules);
if ($validator->fails())
{
return Redirect::to('user/create')
->withInput(Input::except('password'))
->withErrors($validator);
}
$user = new User();
This also means I'm updating the signup.blade.php to show validation
messages. I've sent you this in github too : )
Cheers,
Chris
from laravel-4-bootstrap-starter-site.
I think this relates to this issue also #63
from laravel-4-bootstrap-starter-site.
postIndex() and postEdit() are so similar, do you think there's a way we can keep them combined. I know there's the issue of $user parameter but something like the fix webforge suggested might be nice:
public function postIndex($user=null)
{
$user = ($user == null ? new User() : $user);
(Apologies if you're working on this)
from laravel-4-bootstrap-starter-site.
:) yep!
from laravel-4-bootstrap-starter-site.
Should be fixed now
from laravel-4-bootstrap-starter-site.
Can't really combine, what they do is different.
from laravel-4-bootstrap-starter-site.
Yeah, that's fair enough
from laravel-4-bootstrap-starter-site.
I would agree they are quite similar but they are just enough different to make combining difficult.
from laravel-4-bootstrap-starter-site.
Related Issues (20)
- Tons of composer suggestions after installing... HOT 1
- Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException HOT 10
- Windows installation issues. HOT 1
- Ardent integration not complete? HOT 5
- i want to learn how to do this plataform, how should i start? HOT 3
- class User extends ConfideUser instead of Eloquent ?? HOT 3
- Help me with my database modeling. HOT 1
- Use Chumper/Datatable instead of blim
- ng-admin : An Angular.JS Admin Panel HOT 5
- Laravel 5 support? HOT 9
- Can't find the route for account confirmation
- PHP Notice: Constant LARAVEL_START already defined in /opt/bitnami/frameworks/laravel/bootstrap/autoload.php on line 3 HOT 5
- Has anyone changed the edit/delete buttons to use bootstrap modals with confirm ?
- how can i create new static page?
- Non English URL Problem
- Bootstrap theme rederaning HOT 1
- Screenshots HOT 1
- composer install no work on windows HOT 2
- Zizaco/entrust: Problem in the creation of the role and permission with tinker
- Update for laravel 8.x
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-4-bootstrap-starter-site.