app/Controllers/Story/StoryUploadController.php
// This method is called when the user submits the form
This method is called when the user submits the form
This method is called when the user submits the form
public function postSignUp($request, $response)
  {
    $validation = $this->validator->validate($request, [
      'name' => v::notEmpty()->alpha(),
      'username' => v::noWhitespace()->notEmpty()->UsernameAvailable(),
      'city' => v::notEmpty()->alpha(),
      'country' => v::notEmpty()->alpha(),
    ]);
    if ($validation->failed()) {
      return $response->withRedirect($this->router->pathFor('auth.signup'));
    }
    $usermeta = Usermeta::create([
      'name' => $request->getParam('name'),
      'username' => $request->getParam('username'),
      'city' => $request->getParam('city'),
      'country' => $request->getParam('country'),
      'share_location' => $request->getParam('share_location'),
      'category' => $request->getParam('category'),
    ]);
    $usermeta = Usermeta::orderBy('id', 'desc')->first();
    return $response->withRedirect($this->router->pathFor('storyupload.upload'));
  }
public function postSignUp ( $ request , $ response ) { $ validation = $ this -> validator -> validate ( $ request , [ 'name' => v :: notEmpty ( ) -> alpha ( ) , 'username' => v :: noWhitespace ( ) -> notEmpty ( ) -> UsernameAvailable ( ) , 'city' => v :: notEmpty ( ) -> alpha ( ) , 'country' => v :: notEmpty ( ) -> alpha ( ) , ] ) ; if ( $ validation -> failed ( ) ) { return $ response -> withRedirect ( $ this -> router -> pathFor ( 'auth.signup' ) ) ; } $ usermeta = Usermeta :: create ( [ 'name' => $ request -> getParam ( 'name' ) , 'username' => $ request -> getParam ( 'username' ) , 'city' => $ request -> getParam ( 'city' ) , 'country' => $ request -> getParam ( 'country' ) , 'share_location' => $ request -> getParam ( 'share_location' ) , 'category' => $ request -> getParam ( 'category' ) , ] ) ; $ usermeta = Usermeta :: orderBy ( 'id' , 'desc' ) -> first ( ) ; return $ response -> withRedirect ( $ this -> router -> pathFor ( 'storyupload.upload' ) ) ; }
This method is called when the user submits the form
This method is called when the user submits the form
//if validation fails, stay on signup page //after submit, redirect to storyupload/guidance