wilburpowery

Full Stack Web Developer at BVMedia

Hire Me

Experience

62,530

25 Best Reply Awards

  • Member Since 1 Year Ago
  • 449 Lessons Completed
  • 0 Favorites

15th February, 2018

wilburpowery left a reply on Composer View Is Not Loading Variable Into View • 4 days ago

Please take time to format your code correctly. Use the code syntax.

wilburpowery left a reply on Store New Conference -no Errors But The Conference Is Not Stored • 4 days ago

Is there anything in your log file?

12th February, 2018

wilburpowery left a reply on Production.ERROR: PDOException: SQLSTATE[HY000] [2002] Connection Refused In.... • 1 week ago

Also, you might have mysql running on another port. By default the .env file has it set up for 3306. You might want to check that also.

wilburpowery left a reply on Production.ERROR: PDOException: SQLSTATE[HY000] [2002] Connection Refused In.... • 1 week ago

Local or development?

Looks like mysql is not started in your environment. Maybe you don't have it configured to start automatically and you need to start it manually?

We really need more info about the error. :)

6th February, 2018

wilburpowery left a reply on To Display Logged In Username In Top Div. • 1 week ago

Could I ask why are you doing the Auth manually?

Here's what the php manual says about HTTP cookies. http://php.net/manual/en/features.cookies.php

5th February, 2018

wilburpowery left a reply on Invalid Request (Unexpected EOF) • 2 weeks ago

Unexpected EOF means “unexpected end of file”. Maybe you have some error in your code?

2nd February, 2018

wilburpowery left a reply on Font Awesome 5 Using Laravel-Mix On Laravel 5.5 • 2 weeks ago

Why are you importing FontAwesome 5 from your app.js file??

wilburpowery left a reply on ANY SMS API /Service Where I Can Send Sms For Free For Development. [ I'm Willing To Pay For Production ] • 2 weeks ago

Nexmo offers some credit to use for development purposes. If you need more credit, simply get in contact with them and they'll give you a bit more. Their customer support is really great.

https://www.nexmo.com/

31st January, 2018

wilburpowery left a reply on Duplicate Queries., Different `where` Statements • 2 weeks ago

I think Query Scopes is the way to go. https://laravel.com/docs/5.5/eloquent#query-scopes

Assuming your model name is DB1:

// ignoring class declaration

public function scopeOfEmails($query, array $emails)
{
    return $query->whereIn('email', $emails);
}

Then you would use it as follows:

$query = DB1::ofEmails($verified_user_domains)->get();
$total_clean_count = DB1::ofEmails($verified_user_domains)->where('isspam',false)->count();
$total_spam_count = DB1::ofEmails($verified_user_domains)->where('isspam',true)->count();

Might be a little more code to write, but a lot easier to understand and maintain IMO.

29th January, 2018

wilburpowery left a reply on Angular & Laravel On Forge • 3 weeks ago

You can keep both separate. Or, do all your Angular code in resources/assets/js folder. Laravel by default ships with Vue.js but it's very easy to switch it out for anything you want to use.

wilburpowery left a reply on Server To Handle 100K Daily Traffic • 3 weeks ago

A VSP will do. You should pay for a plan than can handle your expected traffic. Digital Ocean has some good plans.

https://www.digitalocean.com/pricing/

wilburpowery left a reply on How To Prevent Ajax To Repeat Firing The First Request Upon Completing The Second Request • 3 weeks ago

You are adding both events listeners to the document object. To prevent them from firing at the same time, add the event listener to different objecta. ex: two different buttons.

28th January, 2018

wilburpowery left a reply on Best Structure For Vue.js SPA And Laravel Together? • 3 weeks ago

Hey @MyLibrary I developed a few months ago a full SPA with Vue.js and Laravel. I'll share you the repo.

https://github.com/wilburpowery/cashflow-assistant/tree/master/resources/assets/js

But this is the basic structure I always follow when working with Laravel and Vue.js with SPA's. My Structure

25th January, 2018

wilburpowery left a reply on Single Login System For Mobile And Web App !? • 3 weeks ago

You can indeed use Passport. You can build your entire backend as an api and simply use the CreateFreshApiToken to consume your api without sending a token on every request in your front end with Javascript. Your mobile app will need to fetch a token and send it on every request to validate the request. Getting started with Passport is very easy. You can even generate Password grant tokens that that are good if you simply want to send an email and password and receive a token that identifies that user.

Hope it helps.

19th January, 2018

wilburpowery left a reply on What Is Wrong Here? • 1 month ago

No. Same error. First time I've ever seen this. Really weird.

wilburpowery left a reply on What Is Wrong Here? • 1 month ago

No. I have no idea what is wrong. Same error.

wilburpowery started a new conversation What Is Wrong Here? • 1 month ago

// Controller
$channels = Channel::paginate(20);
return view('admin.channels.index', compact('channels'));

// View file
 @forelse($channels as $channel)
        @forelse($channels as $channel)
                <tr>
                    <td>{{$channel->name}}</td>
                    <td>{{$channel->slug}}</td>
                    <td>{{$channel->description}}</td>
                    {{--  <td>{{ $channel->threadsCount }}</td>  --}}
                </tr>
            @empty
                <tr>
                    <td>Nothing here.</td>
                </tr>
            @endforelse
            {{ $channels->links() }}            

I'm getting this error:

(2/2) ErrorException Method links does not exist.

wilburpowery left a reply on SWITCH TO LINUX • 1 month ago

Ubuntu is good. But If you don't have a lot of knowledge on the command line, I'd switch to Ubuntu Desktop. (It has a user interface). https://www.ubuntu.com/desktop

17th January, 2018

wilburpowery left a reply on Should A Controller Be Restricted To Creating/modifying Objects Specifically For That Model? • 1 month ago

This talk from Adam Wathan should help you out. Really great advice! https://www.youtube.com/watch?v=MF0jFKvS4SI

15th January, 2018

wilburpowery left a reply on Auth Login Function Error • 1 month ago

Overriding Laravel's auth is soo simple. And by simply running the make:auth command, you get a lot of things out of the box.

Want to update where the user should be redirected after login? Simply change the following code on your LoginController.

/**
     * Where to redirect users after login.
     *
     * @var string
     */
    protected $redirectTo = '/where-ever-you-want';

wilburpowery left a reply on Map() Not A Function • 1 month ago

Seems strange. The map function is from the Array prototype. It should not give any errors in any environment.

wilburpowery left a reply on Work For Laracasts (Web Designer) • 1 month ago

He will hire another developer sometime this year. Not only PHP though, but some good content should come from the new guy. I can feel a very exiting year coming for Laracasts :)

wilburpowery left a reply on Redirect With Flash Message • 1 month ago

You need to do it from the controller.

return redirect('/some-page')->with('flash', 'Whatever message you want');

wilburpowery left a reply on "report" Function Not Exist In Laravel 5.5 Helpers • 1 month ago

search for the function in the Laravel source code in your vendor file. You might need to run a composer update, just in case you have an older version of the framework.

12th January, 2018

wilburpowery left a reply on Logging In Two Computers At The Same Time? • 1 month ago

I haven't really heard of anything like this before. I even see it as a security issue. I don't really think it's even possible to login a web app in many machines at the same time. Curious to hear what other people think.

11th January, 2018

wilburpowery left a reply on Laravel Or Lumen To Use With React ? • 1 month ago

After reading this article, I think I would always choose Laravel now a days. Obviously you need to think how big and complex your project will be. If you see yourself using queues, jobs, and other of the stuff Laravel provides, go with Laravel. https://medium.com/@laurencei/lumen-vs-laravel-performance-in-2018-1a9346428c01

wilburpowery left a reply on Vue.js 2 - Persisting Property Value Without Vuex • 1 month ago

You can maybe emit a event when a item is deleted and listen for it wherever you need to remove the item. But if it's starts to get out of hand, I 100% recommend using Vuex.

10th January, 2018

wilburpowery left a reply on (laravel Project On Server) HTTP ERROR 500 • 1 month ago

shared hosting?

wilburpowery left a reply on Is It Possible To Pass Variables Like This • 1 month ago

Best of luck with everything @deladels I was not making fun of you. :) :)

wilburpowery left a reply on Best Practice For Fetching Images From Eloquent Models • 1 month ago

How about something like this:

public function getImageAttribute()
{
    return $this->getAbsoluteImagePath($isUrl = true); // I'm only assigning a variable here for readability
}

public function getAbsoluteImagePath($isUrl = false)
{
    $fileName = 'assets/images/' . str_slug($this->name, '-') . '.png';
    if(Storage::disk('public')->exists($fileName)) {
        return Storage::disk('public')->{$isUrl ? 'url' : 'path'}($fileName)
    } else {
        return null;
    }
}


wilburpowery left a reply on Is It Possible To Pass Variables Like This • 1 month ago

Hits himself on the face LOL.

9th January, 2018

wilburpowery left a reply on Two Route Patch To Same Controller But Two Different Methods • 1 month ago

Do you have the three methods created in your BlogController?

8th January, 2018

wilburpowery left a reply on Laravel 5.4 How To Get $id After Form Submit • 1 month ago

Please paste your code again. It's all mixed up and it's very hard to help you like that.

Also, I see you are not sending any idea with the route, and not accepting any $id in your controller method.

// Send an $id
{!! Form::open(['url' => 'edit/{{ $data->id }}', 'enctype' => 'multipart/form-data']) !!}
public function file_update(Request $request, $id)  //Accept the id
{ 
    $file = new File; $file = File::where('id',$id);
    $file->file_suggest = $request->file_suggest; 
    $file->file_sign = $request->file_sign; 
    $file->save(); 
    return redirect()->to('/file_uncheck');             

}

wilburpowery left a reply on Connect API With Laravel Project • 1 month ago

You might like taking a look at Http. It's a wrapper around Guzzle. https://github.com/kitetail/zttp

You can make your request as follows:

Zttp::asFormParams()->post('endpoint', [
    'email' => '[email protected]',
        'password' => 'asdasd'
])

wilburpowery left a reply on Handling Passport Expired Tokens • 1 month ago

If not mistaking, Passport also sends a value saying how long the token will last. You can keep checking and whenever the token is almost expired, send another request to receive a new token.

wilburpowery left a reply on How To V-show From Root Through @click To A Component? • 1 month ago

You can't update a prop. You can create a copy of the prop in your data function and then update your data.

Also, I have no idea what exactly you are trying to do.

wilburpowery left a reply on How Work With Hot Reaload With Laravel-elixir-webpack-react? • 1 month ago

Have you tried gulp watch? You can run that instead of just running gulp.

wilburpowery left a reply on Forum Video Series - PHPUnit Throws Unauthenticated Error • 1 month ago

It would be really good to see the code for the test. To make the test pass, you can expect an exception at the beginning of the test.

$this->expectException();

Also, you can turn on exception handling so that Laravel converts the exception into a proper response.

wilburpowery left a reply on Forum Video Series - PHPUnit Throws Unauthenticated Error • 1 month ago

Did you signed a user in inside your test method?

wilburpowery left a reply on Laravel 5.2 - Vue Integration • 1 month ago

Install the laravel-elixir-vueify and require it after your require elixir.

var elixir = require('laravel-elixir');

require('laravel-elixir-vueify');

elixir(function(mix) {
    mix.browserify('main.js');
});

wilburpowery left a reply on Redirect To 404 From A Blade View Template • 1 month ago

No problem at all.

wilburpowery left a reply on Laravel 5.2 - Vue Integration • 1 month ago

Use the Laravel Elixir Vueify wrapper. https://github.com/JeffreyWay/laravel-elixir-vueify

wilburpowery left a reply on Redirect To 404 From A Blade View Template • 1 month ago

Why not do it from the controller? Why exactly would you do it from the view?

5th January, 2018

wilburpowery left a reply on Get Relationship Data • 1 month ago

You need to have a client_id column in your maintenance_packages table.

Schema::create('maintenance_packages', function(Blueprint $table) {
            $table->increments('id');
        $table->unsignedInteger('client_id');
            $table->string('name', 55);
            $table->integer('hours');
            $table->decimal('price');
        });

4th January, 2018

wilburpowery left a reply on Authenticate Angular5 App In Laravel API Using Passport • 1 month ago

Do you have it configured so it sends the X-Requested-With header in every request also?

3rd January, 2018

wilburpowery left a reply on MySQL Query • 1 month ago

$id = 1;

$groups = DB::table('table_example');

 if($id!='0') {
     $groups->where('id', '=', $id)
 }

  $groups->limit(30)->get();

Try that.

wilburpowery left a reply on Increment Value By Button Click • 1 month ago

You can use the increment method that eloquent provides.

public function addPoint($id)
    {
        $habit = User::find($id);
        $habit->increment('points');

        return redirect('/habits')->with('success', 'Habit created');
    }

wilburpowery left a reply on Best Practice (pattern) For A Method On Model • 1 month ago

I see it very good. This is exactly what an accessor is for.

2nd January, 2018

wilburpowery left a reply on Issue In Sending Mail Using Queue With Passing Data • 1 month ago

All properties you want available in your views should be public. Change it to this: public $userpricealert;

wilburpowery left a reply on ClientException After GuzzleHTTP GET Request To Api Endpoint... • 1 month ago

I have no idea what service you are trying to use. They should have some place in the dashboard to generate some token to send on every page request. What service is it?

Edit Your Profile
Update

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