steveperrycreative

Designer / Developer at Steve Perry Creative Limited

Experience

22,165

0 Best Reply Awards

  • Member Since 2 Years Ago
  • 401 Lessons Completed
  • 4 Favorites

26th August, 2016

steveperrycreative left a reply on Warranty Period For Websites • 7 months ago

No at all @TheNephilim but I make sure that I communicate it well from the start. Most clients take out maintenance plans so it's not really an issue for them.

25th August, 2016

steveperrycreative left a reply on Warranty Period For Websites • 7 months ago

Personally I tell clients it's 30 days from launch and make it clear that it's wise to take out a maintenance plan. I'm a sucker for just fixing stuff like you mention though, after 30 days, and quite often get taken advantage of because I'm always keen to keep clients happy. It's fine as long as you keep a healthy balance and communicate well.

15th February, 2016

steveperrycreative left a reply on User Registration Email Confirmation Issue • 1 year ago

@schir1964 no the tut is using 5.1.*

14th February, 2016

steveperrycreative left a reply on User Registration Email Confirmation Issue • 1 year ago

Yep ok will do.

steveperrycreative started a new conversation User Registration Email Confirmation Issue • 1 year ago

I've been following this tutorial on adding user registration email confirmation but instead of creating my own registration controllers I'm using an amended version of Laravel's auth controllers, bringing it inline with Jeffrey's custom version.

However when a user registers I receive the following error:

ErrorException in AuthController.php line 67:
Argument 2 passed to Prolinked\Http\Controllers\Auth\AuthController::create() must be an instance of Prolinked\Mailers\AppMailer, none given, called in /Users/steve/Server/jasoncampbell/vendor/laravel/framework/src/Illuminate/Foundation/Auth/RegistersUsers.php on line 59 and defined

Which I'd kind of expect but then Jeffery's version is the same and as far as I can tell his route isn't passing a 2nd argument through either but he is not getting this error. Am I missing something from somewhere else perhaps?

My AuthController is:

<?php

namespace Prolinked\Http\Controllers\Auth;

use Validator;
use Prolinked\User;
use Prolinked\Mailers\AppMailer;
use Prolinked\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ThrottlesLogins;
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;

class AuthController extends Controller
{
    /*
    |--------------------------------------------------------------------------
    | Registration & Login Controller
    |--------------------------------------------------------------------------
    |
    | This controller handles the registration of new users, as well as the
    | authentication of existing users. By default, this controller uses
    | a simple trait to add these behaviors. Why don't you explore it?
    |
    */

    use AuthenticatesAndRegistersUsers, ThrottlesLogins;

    /**
     * Where to redirect users after login / registration.
     *
     * @var string
     */
    protected $redirectTo = '/';

    /**
     * Create a new authentication controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('guest', ['except' => 'logout']);
    }

    /**
     * Get a validator for an incoming registration request.
     *
     * @param  array  $data
     * @return \Illuminate\Contracts\Validation\Validator
     */
    protected function validator(array $data)
    {
        return Validator::make($data, [
            'firstname' => 'required|max:255',
            'lastname' => 'required|max:255',
            'email' => 'required|email|max:255|unique:users',
            'password' => 'required|confirmed|min:6',
        ]);
    }

    /**
     * Create a new user instance after a valid registration.
     *
     * @param  array  $data
     * @param  AppMailer  $mailer
     * @return User
     */
    protected function create(array $data, AppMailer $mailer)
    {
        $user = User::create([
            'firstname' => $data['firstname'],
            'lastname' => $data['lastname'],
            'email' => $data['email'],
            'password' => bcrypt($data['password']),
        ]);

        $mailer->sendEmailConfirmationTo($user);

        flash('Please confirm your email address.');

        return redirect()->back();
    }

    /**
     * Listen for our user creation and add our token during that process.
     */
    public static function boot()
    {
        parent::boot();

        static::creating(function($user) {
            $user->token = str_random(30);
        });
    }
}

Let me know if you need to see any other code.

27th July, 2015

steveperrycreative left a reply on Problem Uploading File With Laravel Excel • 1 year ago

Fantastic, thank you! Worked a treat.

steveperrycreative started a new conversation Problem Uploading File With Laravel Excel • 1 year ago

I'm trying to upload a file and add the contents to my database using Laravel Excel. The file is uploaded using a form which posts to my uploadFromCsv method.

When I upload the file I get:

PHPExcel_Reader_Exception in Excel2007.php line 82: Could not open for reading! File does not exist.

My form is:

<form class="form-horizontal" method="POST" action="/ascents/upload">
    {!! csrf_field() !!}
    <div class="form-group">
        <label for="file" class="col-sm-3 control-label">Select CSV File</label>
        <div class="col-sm-9">
            <input type="file" class="form-control" id="file" name="file">
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-offset-3 col-sm-9">
            <button type="submit" class="btn btn-default">Upload</button>
        </div>
    </div>
</form>

And my method is:

    public function uploadFromCsv()
    {
        Excel::load(Input::file('file'), function ($reader) {
            foreach ($reader as $log) {
                $ascent = new Ascent($log->all());
                Auth::user()->ascents()->save($ascent);
            }
        });
        return redirect(route('ascents'));
    }

21st July, 2015

steveperrycreative left a reply on PHP Books • 1 year ago

@polarcubs I think that is possibly one of the longest resource lists I've seen. Thanks for the recommendation.

Thanks everyone, I've started with @ian_h's and Jeffrey's recommendation of PHP Objects, Patterns, and Practice and will work through the rest. It's great so far, really easy to understand and very well written.

20th July, 2015

steveperrycreative left a reply on PHP Books • 1 year ago

Thanks, Ian. They don't have to be Laravel-specific.

steveperrycreative started a new conversation PHP Books • 1 year ago

I'm relatively new to object oriented PHP but I'm slowly beginning to understand the basic principles and I'm comfortable setting up basic classes, methods and putting them to use.

I'd like to start learning more about patterns, conventions and testing. I really enjoy the videos on here and would like some recommendations for some off-screen learning (books!) which are steady enough for a relative beginner.

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.