wilburpowery

Front End Web Developer at BVMedia

Hire Me

Experience

47,590

6 Best Reply Awards

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

29th November, 2017

wilburpowery left a reply on Any Easy Way To Upgrade From 5.2.45 To 5.5.x ? • 1 week ago

Are you up to pay a bit for it? You can use Laravel Shift.

wilburpowery left a reply on BreadCrumbs Packages • 1 week ago

glad it helps @sergey1983

28th November, 2017

wilburpowery left a reply on Trying To Edit A Specific (id) Product • 1 week ago

If you have your code on GitHub, I'll be happy to take a look at it. I can't find your problem by just looking at some snippets.

wilburpowery left a reply on Trying To Edit A Specific (id) Product • 1 week ago

The update method automatically saves the record. No need to use the save method there.

What error it is that you're getting?

wilburpowery left a reply on Trying To Edit A Specific (id) Product • 1 week ago

Please past the code for the route and the controller method so I can take a look. @splendidkeen

wilburpowery left a reply on Certificate Problems With Valet • 1 week ago

Have you tried to remove Valet and install it again? I had an issue also, fixed it for me.

wilburpowery left a reply on Trying To Edit A Specific (id) Product • 1 week ago

Do you have the products relationship on your User model?

wilburpowery left a reply on Global EventBus Testing Problem • 1 week ago

@bugsysha maybe it's because while testing, there is no window object? I'm not sure really. I have little experience with testing Vue components.

wilburpowery left a reply on BreadCrumbs Packages • 1 week ago

You can also use the v3 of that package, it supports Laravel 5.4. https://github.com/davejamesmiller/laravel-breadcrumbs/tree/3.x

wilburpowery left a reply on BreadCrumbs Packages • 1 week ago

Do you have a test suite for your application? If so, upgrading is soo easy.

wilburpowery left a reply on Netflix • 1 week ago

I guess you can simply use airplay to stream the video to your apple tv. But if you're gonna watch coding tutorials, you should have your computer and practice. IMHO

wilburpowery left a reply on Trying To Edit A Specific (id) Product • 1 week ago

No need to have that $update variable. Or the Auth check before the $product->update.

wilburpowery left a reply on Trouble Provisioning A Server (VPS) • 1 week ago

If you are using Forge, why not create the server from the Forge Dashboard?

wilburpowery left a reply on Trying To Edit A Specific (id) Product • 1 week ago

I suggest you give Laravel 5.4 from scratch a view. You still need to learn the fundamentals of Laravel. https://laracasts.com/series/laravel-from-scratch-2017

wilburpowery left a reply on Trying To Edit A Specific (id) Product • 1 week ago

fetch the product. And then update only that record.

public function postProductEdit(Request $request, $id){
        $this->validate($request, [
            'title'=> 'max:140',
            'brand'=> 'max:20',
            'sku'=> 'max:20',
            'description'=> 'max:140',
            'price'=> 'max:14',
            'availability'=> 'max:20',
        ]);

$product = auth()->user()->products()-?findOrFail($id);

// Update the product now.
$product->update([
        'title' => $request->title,
            'brand' => $request->brand,
            'sku' => $request->sku,
            'description' => $request->description,
            'price' => $request->price,
            'availability' => $request->availability        
]);

return redirect()
            ->route('products.edit', compact('product'))
            ->with('info', 'Your product has been updated.');

}

wilburpowery left a reply on Trying To Edit A Specific (id) Product • 1 week ago

You have to use value="{{ old('title')}}". Old is a helper function that will fetch any data sent back with the request. You only need to pass the name of the value. (title is the name you have on your input field).

wilburpowery left a reply on Vue Tabs Open The Correct Tab On Page Load • 1 week ago

on the mounted cycle method you can check if there's a #whatever-tab in the url, and show that specific tab.

wilburpowery left a reply on Trying To Edit A Specific (id) Product • 1 week ago

Where are you getting the product variable from? You need to accept the $id of the product being sent in the request, and you can fetch it from the database.

public function getProductEdit($id){
    $product = auth()->user()->products()->findOrFail($id);
        return view('products.edit', compact('product'));
}

wilburpowery left a reply on Trying To Edit A Specific (id) Product • 1 week ago

You don't need to specify the full class name of the controller. The path is relative to App\Http\Controller.

wilburpowery left a reply on Trying To Edit A Specific (id) Product • 1 week ago

Another thing, Keep your routes restful.

Route::get('products/{product}/edit', '[email protected]')->name('products.edit')->middleware('auth:partner');

wilburpowery left a reply on Trying To Edit A Specific (id) Product • 1 week ago

You are not sending no $product variable. Notice how you use compact('id') which sends an $id variable.

PS: Please stop using Facades in your views. Send through all the data you need via the controller.

26th November, 2017

wilburpowery left a reply on Custom Error Message For Array Value In Laravel Validator • 2 weeks ago

Are you using Laravel 5.5? If so, I suggest you use the new Custom Validation Rules. https://laravel.com/docs/5.5/validation#custom-validation-rules

wilburpowery left a reply on Project Developed With Laravel 5.2 Uploaded From Local To Host • 2 weeks ago

Did you deploy on a shared hosting?

24th November, 2017

wilburpowery left a reply on Extend Subscription • 2 weeks ago

Go to settings, my subscriptions, and change it to a yearly one.

wilburpowery left a reply on Eager Loading Relationship Returning Entire Table • 2 weeks ago

Your logic is off. Please read a bit more about eloquent relationships. When your method name is different than the column on your database, you need to provide the column name.

wilburpowery left a reply on Trying To Get Property Of Non-object • 2 weeks ago

The rules method on a form request object should only return an array with the rules. You have access to this in other methods, like authorize. Also, I see your trying to ensure the slug is unique. You don't really need that id nowhere. unique:brands,slug ensures that in the brands table, the slug column is unique for each record.

wilburpowery left a reply on Trying To Get Property Of Non-object • 2 weeks ago

I don't really see the point of your code. What are you trying to do?

wilburpowery left a reply on Oracle Series • 2 weeks ago

I don't think Jeffrey has much experience working with Oracle. But it may help many devs. ?

wilburpowery left a reply on How Backend Talsk With Frontend. • 2 weeks ago

All your Javascript code will go in resources/assets/js/. If you want your entire front end with React, you can create all the routes you need to fetch and send data to your Laravel application. Using React, you send ajax request wherever you need.

wilburpowery left a reply on [ErrorException] Symlink() Has Been Disabled For Security Reasons • 2 weeks ago

I can't think of another way really. A VPN is really not that expensive. You can get one on linode or DigitalOcean for like 5$/month

wilburpowery left a reply on Laravel Vs Lumen • 2 weeks ago

If you'll only ever build an api, I think Lumen is a great option.

It's a similar syntax to Laravel, you get most of the Laravel goodies and it's super fast.

wilburpowery left a reply on [ErrorException] Symlink() Has Been Disabled For Security Reasons • 2 weeks ago

I take it that at the moment your using the local disk in the storage options. I think you might be able to get it working using Amazon S3 or similar because you would not be required to create the symbolic link to access the files in your /public/storage directory.

wilburpowery left a reply on Use Javascripts In Multiple Layouts • 2 weeks ago

I don't think it's a good practice to extend multiple layouts in a single file.

All your template code should go in a single file, and you extend that file where needed. And also, you need to have a @yield('contentMain') on your template.

I suggest you give Blade's documentation another read. https://laravel.com/docs/5.5/blade

wilburpowery left a reply on Cannot Use V-for On Stateful Component Root Element Because It Renders Multiple Elements. • 2 weeks ago

If the name of your component is tr you can never use that. tr is a reserved HTML tag. Vue will always blow up. I recommend you create a component for the entire table. and just using a v-for in the tr HTML tag. If you want to reuse the table and change the title, I recommend you take a look a component scopes.

wilburpowery left a reply on Validator Uniqueness Vs DB Uniqueness Constraint • 2 weeks ago

@gregrobson is completely right. I always think of creating my database with the necessary security, thinking like I would have no security on my code. This makes me secure every aspect possible at the database level.

wilburpowery left a reply on [ErrorException] Symlink() Has Been Disabled For Security Reasons • 2 weeks ago

Laravel is recommended to be used with a VPN, where you have full control over your server. All I can think of is that you don't have enough permissions to create a symbolic link on that shared server.

wilburpowery left a reply on JavaScript Or JQuery Implementation In Laravel • 2 weeks ago

Why would you do this directly from the controller? In resources/assets/js/app.js is where all your Javascript code should go to be compiled.

Can you explain a little more what you want to accomplish?

wilburpowery left a reply on How To Catch Incorrect URLs In Blade Via Tests? • 2 weeks ago

To test anything for your frontend, you should use something like Dusk. Tools like PHPUnit only test the underlying logic of your application. If they're Unit tests, they test small pieces of your code. Feature tests, evaluate larger parts of your application, like routes and other functionality.

wilburpowery left a reply on Message Pop Up With Yes /no In Laravel • 2 weeks ago

You should use Javascript for this. You can use something like SweetAlert2 to show a warning to the user, and if they click the delete button on the alert, delete the record.

That would be my approach.

wilburpowery left a reply on Create Slug + Id • 2 weeks ago

You can also use modal events to create the slug, in this way, you can keep your controller method a little more clean.

wilburpowery left a reply on Laravel Soft Delete Cascade • 2 weeks ago

I would assign a foreign key constraint on your migrations for domains, projects, and tasks. Like this:

$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade');

You can also use Model events for this. On the Company model's boot method, listen for Eloquent's deleting event and simply use the relationships to delete all domains, projects, and tasks.

wilburpowery left a reply on Big Discount!! • 2 weeks ago

I think @JeffreyWay is the person for this. He can maybe take a look after the Thanksgiving time off.

23rd November, 2017

wilburpowery left a reply on Problem With Webpack And Modules Availability • 2 weeks ago

Try assigning Chart to the window object. Like:

window.Chart = require('chart.js');

You must keep in mind that you are using a build system. You need to initialize all those libraries manually.

If you were simply using a cdn, you can call the Chart object itself.

wilburpowery left a reply on Call To A Member Function Middleware() On Null • 2 weeks ago

I think you have a syntax problem there. Can't really appreciate anything with your code example.

wilburpowery left a reply on How To Compile Additional Sass And Js In With Webpack • 2 weeks ago

You only have one instantiation of mix so, you should be chaining those methods. Like this:

mix.js('resources/assets/js/app.js', 'public/js')
   .sass('resources/assets/sass/app.scss', 'public/css')
   .sass('resources/assets/sass/try.scss', 'public/css')
   .copy('node_modules/at.js/dist/css/jquery.atwho.css', 'public/css/vendor')

Also, I think you can just pass an array to .sass with all the entry files.

wilburpowery left a reply on Global EventBus Testing Problem • 2 weeks ago

Hope it helped, @bugsysha.

wilburpowery left a reply on Global EventBus Testing Problem • 2 weeks ago

Think of Vue as a class. You need those parentheses.

wilburpowery left a reply on Global EventBus Testing Problem • 2 weeks ago

window.Event = new Vue();

wilburpowery left a reply on Validator Uniqueness Vs DB Uniqueness Constraint • 2 weeks ago

As you keep growing in your career, you'll find that some rules you learn at the beginning are sometimes meant to be broken. Like I said, it all depends on whatever you're working on.

Sometimes, I have that kind of validation on both levels, and on some other projects, I simply delegate to by Database protection.

It's also important to keep in mind the number of developers that will be working on the codebase.

Edit Your Profile
Update

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