Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/04/2023 in all areas

  1. Believe it or not, it finds all images and anchors that have a "title" attribute.
    1 point
  2. Given that the website is about a company whose work is based on physical presence, namely "interior renovation" and "bespoke carpentry", concentrate your efforts on knowing whether the site is fast enough for potential customers in the area. In other words, it doesn't really matter much to me on the US west coast that your site takes 1-2 seconds to load a page because I'm not going to be requesting your services. I do see a number of assets loaded - Javascript and CSS and such - and each one takes a noticeable fraction of a second to load, however they load in parallel so that doesn't add much time to the overall page load. And they do appear to be properly cached so they'll only need to get loaded one time. That said, you could look into a CDN. Especially for common things like jQuery, where all you have to do is point to one of the free CDNs instead of having it load from your own servers. Beyond that, the first question to answer for yourself is how much money you want to spend on improving performance; for example, doing things like hosting your site in multiple geographic zones will speed up international and overseas traffic, but it isn't necessarily cheap to do.
    1 point
  3. Controllers are not models. Having a controller that handles CRUD for Categories is irrelevant to controller built for products (that happen to include Categories. In your product controller, you should use eloquent to query for the categories. I'd expect to see something like this: $categories = Categories::all(); return view('products.create', ['categories' => $categories]); Then in your product blade template you will build the category drop down in the list using something like: <select name="category" id="category"> @foreach ($categories as $category) <option value="{{ $category->id }}">{{ $category->name }}</option> @endforeach </select> It's good to put this into its own partial template and include it, if you expect to use this type of code in multiple places. That way any style classes you might add or changes, will be reflected throughout the system, rather than having to go through and change the same code multiple times. So you will want to put code similar to what I have shown in it's own blade file, which you might name category.blade.php. Make sure you understand where you need to put templates and how you will reference them when including. So your product.blade.php template would include category.blade.php using something like this: <form method="POST" action="{{ route('product.new') }}"> // whatever other stuff @include(category) <button name="submit" type="submit">Submit</button> </form> This assumes that you have a method in your product controller that has a named route setup for it, pointing to product.new. Hopefully you get the idea.
    1 point
This leaderboard is set to New York/GMT-05:00
×
×
  • 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.