Jump to content

hschillig

New Members
  • Posts

    4
  • Joined

  • Last visited

hschillig's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I'm looking for a PHP Developer, preferably someone who is familiar with MVC frameworks such as Laravel. Please message me your bitbucket code or if you prefer to send in email, I will give you my email after you send a note. Please include your hourly rate or if you prefer to be paid by the project (feature), please list a general explanation of that. This is for a gaming site called Evocality, a sim breeding site. You'll be working with me, the main developer, but this is a long-term project! So please have open availability! Thank you, Haley
  2. The entire code is this: public function insertMedia($productId, $type, $name, $description, $file, $input) { if( ! $this->validateMediaType($type) ) { MsgConsole::setError('That is an invalid media type!'); return false; } for($i = 0; $i < count($input[$file]); $i++) { // Assign variable for easier use $file = $input[$file][$i]; $media = new ProductMedia(); $media->product_id = $productId; $media->name = $input[$name][$i]; $media->description = $input[$description][$i]; $media->type = $this->getMediaTypeInt( $type ); // Generate a unique url and attached the user_id $fileName = uniqid($productId.'_') . '.' . $file->guessClientExtension(); $media->file_path = $fileName; if( ! $media->save() ) { if($media->errors()->has($file)) { MsgConsole::setError('Your file may have not generated a unique combination. Please try uploading again.'); return false; } MsgConsole::setError($media->errors()->first()); return false; } else { if( ! $this->uploadFile($file, $fileName) ) return false; } } return true; } It's erroring out on this line actually: $file = $input[$file][$i]; But when I do a var_dump on it, it shows this: object(Symfony\Component\HttpFoundation\File\UploadedFile)[9] private 'test' => boolean false private 'originalName' => string 'roi484-salesflyer-cf.pdf' (length=24) private 'mimeType' => string 'application/pdf' (length=15) private 'size' => int 286211 private 'error' => int 0 ANSWER: Ah, it's because I was overwriting $file which was passed as an argument...
  3. When I did a var_dump on $input[$file], it spits out this: array (size=1) 0 => object(Symfony\Component\HttpFoundation\File\UploadedFile)[9] private 'test' => boolean false private 'originalName' => string 'roi484-salesflyer-cf.pdf' (length=24) private 'mimeType' => string 'application/pdf' (length=15) private 'size' => int 286211 private 'error' => int 0 But this is erroring out: for($i = 0; $i < count($input[$file]); $i++) It's saying: $file just holds 'sheet_file', the name of the input field so I know what to reference. Any help here? Thanks!
  4. Omg nevermind. So sorry for the post.. Apologies. I wasn't observing enough. I called Verify::forgotPassword instead of User::forgotPassword so it would use the User properties and not the Verify's default properties.
  5. Ok so I have a Verify object. class Verify extends Ardent { protected $table; public $autoPurgeRedundantAttributes = true; public static $passwordAttributes = array('password'); public $autoHashPasswordAttributes = true; public static $rules = array( 'email' => 'required|unique:users,email|email', 'password' => 'required|confirmed', 'password_confirmation' => 'required', 'fname' => 'required|max:30', 'lname' => 'required|max:40', 'address' => 'required|max:50', 'city' => 'required|max:50', 'state' => 'required|max:2', 'zip' => 'required|max:6', 'phone' => 'required|max:15' ); protected $fillable = array('email', 'password', 'fname', 'lname', 'address', 'city', 'state', 'zip', 'phone'); protected $status = array( 0 => 'inactive', 1 => 'confirmed' ); protected $identify = 'email'; // identify column in the db } But when I extend it and try to overwrite the $identify property, it still uses the 'email' value instead: <?php namespace Intellect\Alkharia\Models\User; use Intellectproductions\Verify\Verify; use Zizaco\Entrust\HasRole; class User extends Verify { public static $rules = array( 'username' => 'required|alpha_dash|unique:users,username|max:30', 'email' => 'required|unique:users,email|email|max:50', 'password' => 'required|confirmed', 'password_confirmation' => 'required', 'name' => 'required|max:35', 'birthday' => 'required|date_format:Y-m-d', 'verification' => 'required|equals:4' ); protected $fillable = array('username', 'email', 'password', 'name', 'birthday'); protected $identify = 'username'; // identify column in the db } But all the other properties successfully overrode. Here is the method in the Verify object: /** * Forgot password * */ public function forgotPassword($username) { dd($this->identify); $user = Verify::where($this->identify, $username)->first(array('id', 'email', 'username')); dd($user); if($user) { // user was found so generate token and send email $token = md5( uniqid(mt_rand(), true) ); $values = array( 'email'=> $user->email, 'token'=> $token, 'created_at'=> new \DateTime ); \DB::connection()->table('password_reminders') ->insert( $values ); $this->sendResetEmail(array('user' => $user, 'token' => $token)); \Session::flash('message', 'Your instructions on how to reset your password has been sent to your email.'); return true; } else { \Session::flash('error', 'That email does not exist!'); return false; } } dd($this->identify) will spit on the value of it. And it says 'email' still, not 'username'.. Any ideas on why?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.