topvillas

Experience

190,745

222 Best Reply Awards

  • Member Since 3 Years Ago
  • 469 Lessons Completed
  • 0 Favorites

23rd September, 2018

topvillas left a reply on Nova Folder? • 3 weeks ago

I haven't used Nova yet but from watching Taylor's talk about it at Laracon, that looks like the normal behaviour.

22nd September, 2018

topvillas left a reply on JS Template Component • 3 weeks ago

The quick answer is no. Not without a transpiler.

topvillas left a reply on Checkout With Credit Card Validation In Laravel • 3 weeks ago

Paypal.

21st September, 2018

topvillas left a reply on Transform Blade In A Vue • 3 weeks ago

Give the breadcrumb items to the component as a prop and loop over them with v-for

20th September, 2018

topvillas left a reply on Access To Request Element That Start With The Same Name • 4 weeks ago

Can't you just use the PHP array syntax?

{{Form::text('name[],'',array('class'=>'form-control'))}}

You'll then be able to use the posted input name as an array.

topvillas left a reply on Not Displaying Google Charts In Laravel App • 4 weeks ago

What does the analytics variable look like if you view the source?

19th September, 2018

topvillas left a reply on Separating API Controllers And Web Controllers • 4 weeks ago

Create an API directory in the controllers directory and namespace the controllers.

15th September, 2018

topvillas left a reply on Cross Project Login • 1 month ago

If it's a standard site (meaning not sending AJAX requests) then that's not going to be possible as you can't instruct the browser which headers to send. You could try and use cookies but neither of the sites will be able to read cookies from other.

I don't know though, somebody else might have a bright idea about how to achieve this.

Like I said though, the other solution is a seperate service for authentication that both sites can contact.

topvillas left a reply on Cross Project Login • 1 month ago

It's possible and everyone's life would be easier if everything was automated.

The problem you have is sharing sessions. I've never done anything like it but my first thoughts are that you'll need to create an auth service for different projects to contact.

topvillas left a reply on When To Use Config Files? • 1 month ago

Config files ARE associative arrays.

There's no hard and fast rule about when to create them but it's a lot tidier than putting stuff randomly in classes.

topvillas left a reply on Only Show Completed Tasks • 1 month ago

Sounds like you need to use a scope ...

https://laravel.com/docs/5.7/eloquent#query-scopes

topvillas left a reply on "normal" Php Project With Laragon Possible? • 1 month ago

Yes.

topvillas left a reply on Should All Items Data Be Load In Vuex? • 1 month ago

No, the flux pattern is useful if you use data in a complex way across your site. If you're just fetching data to display then forget it.

14th September, 2018

topvillas left a reply on Should I Pass $request To Repository? • 1 month ago

I'd say no. The repository shouldn't be concerned with the request, that's the controller's responsibility.

I'd pass an array of values fetch from the request.

topvillas left a reply on Http.get • 1 month ago

What do you mean by storing http.get(API)?

You're not storing anything, you're just calling the angular http service.

topvillas left a reply on How Not To Repeat Your Code In All Controller Routes? • 1 month ago

Create a private function and put the common stuff in there.

topvillas left a reply on Http.get • 1 month ago

Assuming http is a reference to axios or the fetch client. How else are you going to consume an API?

11th September, 2018

topvillas left a reply on Vue Problem • 1 month ago

Give us some code and we might be able to help.

topvillas left a reply on How To Insert Into Table Only If The Status Is "approved" In Other Table? • 1 month ago

Yeah, please format your code and we might be able to help a bit more.

https://help.github.com/categories/writing-on-github/

topvillas left a reply on How To Insert Into Table Only If The Status Is "approved" In Other Table? • 1 month ago

Do a query to check the approved status then use an if statement.

10th September, 2018

topvillas left a reply on Membership Website • 1 month ago

composer create-project --prefer-dist laravel/laravel external-website

topvillas left a reply on Using Components Within Components • 1 month ago

Try import Building from './building.vue'

9th September, 2018

topvillas left a reply on Why .env And App/config.php Has Same Config? And Why Config.php Is Used? • 1 month ago

Your app code will be unaffected.

I suggest you read the docs about configuration ...

https://laravel.com/docs/5.6/configuration#determining-the-current-environment

topvillas left a reply on Why .env And App/config.php Has Same Config? And Why Config.php Is Used? • 1 month ago

Hah! A pretty important type :D

Edited!

topvillas left a reply on Why .env And App/config.php Has Same Config? And Why Config.php Is Used? • 1 month ago

.env is not where you'll store anything that you need to keep secret. API keys. password etc.

config.php is where you actually configure things used by the app (possibly using the secret stuff stored in .env).

Local is your development environment, so you want to have errors turned on and production is where you don't want anyone to see what might have gone wrong (just a HTTP 500 error page).

7th September, 2018

topvillas left a reply on Route Model Binding For 2 Routes Does Not Work As Expected • 1 month ago

Yeah, patterns are the same. There no way for the router to know your not looking for a category.

topvillas left a reply on Promotion Discount Syatem In Laravel • 1 month ago

Store the discount details as json (you're using Mongo so not a biggie).

Create a class, implementing an discount interface, for each type of discount.

6th September, 2018

5th September, 2018

topvillas left a reply on Define A Variable In Console • 1 month ago

Maybe you could rephrase the question. At the moment, it doesn't make sense.

topvillas left a reply on "Global Instance" Of A Class Everywhere • 1 month ago

Use a service provider and bind the class to the app.

app()->singleton('my_security', function() {
    return new MySecurity;
});

3rd September, 2018

topvillas left a reply on Get Model's Class Name From Eloquent Collection Even If The Query Does Not Return Any Results • 1 month ago

There isn't a model. The collection is empty.

But, you might find this useful.

https://laravel.com/docs/5.6/eloquent-collections#custom-collections

Create a custom collection and store the model name in it.

topvillas left a reply on Get Model's Class Name From Eloquent Collection Even If The Query Does Not Return Any Results • 1 month ago

Yeah, you're right. But you still can't get the model name.

2nd September, 2018

topvillas left a reply on Blade Syntax Inside JQuery • 1 month ago

Is the javascript inline?

1st September, 2018

topvillas left a reply on Binding Many Singleton Is Harmful ? • 1 month ago

No, you couldn't instantiate a bound object at startup because they're transient.

topvillas left a reply on Binding Many Singleton Is Harmful ? • 1 month ago

Yeah, the bindings will happen with every request but they'll only be instantiated when you need them. And no, instantiating classes has pretty much zero overhead.

topvillas left a reply on About Domain Name And Stuff • 1 month ago

Watch the Laravel from scratch series.

31st August, 2018

topvillas left a reply on Problem Loop Json In V-for Vue.js • 1 month ago

this.hubs = data

topvillas left a reply on Problem Loop Json In V-for Vue.js • 1 month ago

You need to assign the data to hubs.

topvillas left a reply on Parent_child • 1 month ago

Give each row a parent or child id.

30th August, 2018

topvillas left a reply on "Cannot Declare Class Already In Use" Integrating Legacy File System • 1 month ago

You could possibly use an alias.

use Bankdate as BankdateSomething

29th August, 2018

topvillas left a reply on PATCH Form Does Not Call Update Function • 1 month ago

Doing a bit of reading, put, patch and delete aren't part of the html 5.0 spec. So it's not really a browser thing.

topvillas left a reply on DIPLAY BUTTON NEXT PREVIEW IN DATATABLES • 1 month ago

If you have the page number add one to it.

Edit Your Profile
Update

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