Member Since 1 Year Ago
4,280 experience to go until the next level!
In case you were wondering, you earn Laracasts experience when you:
Earned once you have completed your first Laracasts lesson.
Earned once you have earned your first 1000 experience points.
Earned when you have been with Laracasts for 1 year.
Earned when you have been with Laracasts for 2 years.
Earned when you have been with Laracasts for 3 years.
Earned when you have been with Laracasts for 4 years.
Earned when you have been with Laracasts for 5 years.
Earned when at least one Laracasts series has been fully completed.
Earned after your first post on the Laracasts forum.
Earned once 100 Laracasts lessons have been completed.
Earned once you receive your first "Best Reply" award on the Laracasts forum.
Earned if you are a paying Laracasts subscriber.
Earned if you have a lifetime subscription to Laracasts.
Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.
Earned once you have achieved 500 forum replies.
Earned once your experience points passes 100,000.
Earned once your experience points hits 10,000.
Earned once 1000 Laracasts lessons have been completed.
Earned once your "Best Reply" award count is 100 or more.
Earned once your experience points passes 1 million.
Earned once your experience points ranks in the top 50 of all Laracasts users.
Replied to Packaging My App For Resale, How?
You're either going to have to build something that interfaces with the .env file or something of that nature. You also need to take into account the issues Laravel has running on shared hosts. Here is a installer that you could see how they are doing things and build your own or use this one https://github.com/rashidlaasri/LaravelInstaller
Replied to Multiple DB In Project
You could possibly use a package for this. One that comes to mind is https://github.com/tenancy/tenancy
Replied to Create API
Why couldn't you do something like this?
$items = Items::all()->toJson();
return view('items.create', compact('items'));
Replied to Laravel Update Panel (.NET Style)
this is the guide I always use whenever I need to use dependent dropdown menus. https://investmentnovel.com/laravel-dependent-dropdown-tutorial-with-example/
Replied to Moving To Linux
You would want to use Homestead then. https://laravel.com/docs/5.8/homestead
Replied to Setup A Shop.stechmax.com
shop.stechmax.com is just a subdomain that you setup. Depending on your hosting setup, the setup could be different. No need to purchase a new domain.
Replied to Add A Div Every X Number If Items
This is exactly what I was looking for! I'm going to study this code now since I have a base and see how I can refactor to filter in the controller instead since that is what you have suggested as a better route to pursue.
Replied to Add A Div Every X Number If Items
@snapey So what i'm trying to do is I have services which show content plus show service listings. So what I was trying to do is bring in the services and only show the services that have a category title that matches the page title. which is does currently. I then wanted to take the service listing list that is displayed on the page and make lists of 4 in each column. I hope this makes more sense now of what i'm trying to achieve. I could be totally going at this the wrong way.
Replied to Add A Div Every X Number If Items
@cronix here is my current code as following.
<div class="serviceListingColumn">
<ul>
@foreach($serviceListings as $serviceListing)
@if ($serviceListing->service_category == $services->title)
<li class="serviceListingItem">{{$serviceListing->service_name}}</li>
@endif
@if($loop->iteration % 4 === 0)
</ul>
</div>
<div class="serviceListingColumn">
<ul>
@endif
@endforeach
</ul>
</div>
Replied to Add A Div Every X Number If Items
@jlrdw the problem is I have 10 items in my list. Which leaves a remainder of 2.5. I'm asking how do I handle the remainder so it doesn't add two blank divs are the end?
Replied to Add A Div Every X Number If Items
@neven this works great. The only issue I cannot seem to resolve is it seems to leave a blank <div class=""></div>
at the end and I cannot seem to figure out why. Could anyone shed some light on this issue?
Replied to Add A Div Every X Number If Items
I actually have never used this before. Can someone give me a little more of an example so I can see how I need to structure this? I was able to get it to chunk correctly but it leaves two empty <div class="row"></div>
. Now that the other method was suggested I would like to try to it this way since everyone seems to be in agreement this is the correct way rather than chunk
.
Replied to Add A Div Every X Number If Items
@jlrdw i've been messing with it for about 4 hours and ran out of senarios.
Replied to Add A Div Every X Number If Items
I tried this and it prints out on the screen put it also has several empty arow
at the end.
@foreach ($serviceListings->chunk(3) as $chunk)
@foreach ($chunk as $product)
<div class="row">
@if ($product->service_category == $services->title)
<li class="serviceListingItem">{{$product->service_name}}</li>
@endif
</div>
@endforeach
@endforeach
Started a new Conversation Add A Div Every X Number If Items
I have data that is being output into the view and it is working great. But I need a way to group the items. I would like to be able to wrap every 4th item with a div. I have tried using chunk
but have gotten errors.
my controller is as follows. Service listing is the one i'm using to get a list of service listings.
public function show($slug) {
$serviceListings = ServiceListing::get();
$services = Service::where('slug', $slug)->firstOrFail();
return view('services.show')->with('services', $services)->with('serviceListings', $serviceListings);
}
my view looks like this. I can get chunk to work correctly but once I put the if statement in there to check for service category it tells service_category it not a instance of this collection.
<div class="servicesListingWrapper">
<h3>Some of the services we offer.</h3>
<div class="servicesListing">
<div class="serviceListingColumn">
<ul>
@foreach($serviceListings as $serviceListing)
@if ($serviceListing->service_category == $services->title)
<li class="serviceListingItem">{{$serviceListing->service_name}}</li>
@endif
@endforeach
</ul>
</div>
</div>
</div>
Replied to Error Migrating Tables For Bitfumes/laravelAuth Package On Laravel 5.8
add use Illuminate\Support\Facades\Schema;
so it looks like this
use Illuminate\Support\Facades\Schema;
public function boot()
{
Schema::defaultStringLength(191);
}
Replied to In Shared Hosting Environment, How To Hide .env File From Public?
@yougotnet the way a laravel installation works is instead of using public_html laravel uses public instead. So you have to look at it that way and you will see that the .ENV file is outside of the public folder which makes it inaccessible and secure. I hope this helps you out.
Replied to In Shared Hosting Environment, How To Hide .env File From Public?
@jlrdw Not sure how putting your project on the same level as public_html is very unsecure? Consider this scenario and correct me i'm wrong.
home/user
-public_html -> home/user/source/public (symlink)
-source(laravel files)
if this is unsecure and incorrect let me know because i've done it wrong on many sites.
Replied to Bluehost Hosting Service To Laravel
just a VPS would be great. You can get a cheap VPS anywhere. Not really any host that offers integration.
Replied to In Shared Hosting Environment, How To Hide .env File From Public?
Put everything on the same level as public_html and then create a symlink between public_html and the public folder in your laravel install.
Replied to Run Artisan Commands On Production Server
Have you installed Composer, or Laravel on this server? PLEASE BE EXPLICIT WITH YOUR ANSWERS, SO I CAN EASILY UNDERSTAND. THANK YOU
Replied to Laravel 5.7 | External Server Router Error
Why is this looking in public_html for this file? This file should never be in your public_html folder. You need to upload your installation correctly outside of the root or your leaving yourself wide open. Here is a good walk through https://www.5balloons.info/hosting-laravel-5-5-project-on-shared-hosting-hostgator/ or you can throw your installation in the root and create a symlink to point to your public_html.
Replied to Backpack PageManager InvalidArgumentException View [pages.normal] Not Found
glad you were able to get this solved. Please mark as solved.
Replied to 503 Service Unavailable For A Package When Deploying On Shared Hosting
if you have Cpanel Access then you need to configure your FastCGI timeout to be longer. The issue is with this and not on the laravel side of things.
Replied to 503 Service Unavailable For A Package When Deploying On Shared Hosting
Remove the enablereuse=on option on your Proxy line, so that it reads
<Proxy fcgi://mywebsite/ retry=0>
See if this works. Not sure if you have access to do this or not.
Replied to Laravel Passport | Login/Register Redirects To Welcome Page
This is how Laravel's authorization works. You login and then you are redirected. https://laravel.com/docs/5.8/authentication#included-routing you can also view this tutorial to learn more about redirection https://codeburst.io/learn-how-to-redirect-authenticated-users-to-corresponding-path-in-laravel-dd613e2f9e3
Replied to Backpack PageManager InvalidArgumentException View [pages.normal] Not Found
It's telling you that your missing your view file which would be /pages/normal.blade.php
in your views folder.
return view('pages.'.$page->template, $this->data);
in your page controller sets this.
Replied to Config Laravel Installation On Ubuntu
did you add this? $HOME/.config/composer/vendor/bin
?
Replied to How To Add Custom Menu In Voyager Laravel?
The first code is if you just want to use the menu using their default styling with bootstrap.
Menu::display('main', 'bootstrap');
The following code block allows you to add custom styling to your menu out of the box. If you wish to use this code block you would place this
<ul>
@foreach($items as $menu_item)
<li><a href="{{ $menu_item->url }}">{{ $menu_item->title }}</a></li>
@endforeach
</ul>
in a blade file resources/views/my_menu.blade.php. then you would display it in your view file where you want it to display. using Menu::display('main', 'my_menu');
Replied to Sublime, Not Best Tool For Larger Projects And Debugging?
I use sublime for all of my projects. I know many developers prefer PHP Storm, but I find Sublime does just fine for me. I can get by usually by using DebugBar for debugging.
Replied to Upwork Clone That Is Build In Laravel?
Everything that is wrong with this.... If the client wants a quality product they need to pay for the time and effort put into said project. If they want it quick and cheap, it won't be quality. If they want quality it won't be quick and cheap. I would inform and educate your client, if they don't like that solution, move on.
Replied to Laravel
Bootstrap imports the bootstrap files in the installation. Are you needing the actual uncompiled files for any particular reason?
Replied to How To Change Password?
You have received an answer. Simply asking for coding is not encouraged. Try to do the code yourself and then whenever you run into an issue, then ask for assistance. But jumping on here demanding for free coding for your project is not the way to go. Laravel has a learning curve and seeing you have only completed one lesson I can understand why you are lost on how to accomplish simple tasks in Laravel. I would suggest like many other have and say you need to take a step back and learn laravel, attempt some personal projects before jumping into a paid laravel gig. I maybe out of line and others may disagree, but I feel laravel as a profession is not for you until you have a good understanding of how the innerworkings of laravel work for starters.
Replied to How To Test Why My View-Composer Isn't Working
First I would add the view facade before the service provider in ComposerServiceProvider
Replied to Laravel Error 500, Welcome Page Not Loading
@gemilyd you need to read my comment and this will fix your issue. You cannot use a .env.example.
Replied to How To Make Links Clickable
If you could post some code or more of an explanation of what you're looking for we can help more. Your request is a little vague on what you're actually trying to achieve.
Replied to Sending Variable To All Blade Views
you're going to want to look at https://laravel.com/docs/5.8/views#passing-data-to-views and you will see how to use view composers to achieve this.
Replied to Welcome.blade.php Not Working
I would suggest following along with a video tutorial such as https://laracasts.com/series/laravel-from-scratch-2018 to learn more about laravel, the setup process and the coding process before trying to dive in head first. Laravel does have a learning curve and not something that can be dove into right off the bat.
Replied to Welcome.blade.php Not Working
How are you trying to access your laravel install? Are you working on a local environment? If so how is your local environment setup?
Replied to Laravel Error 500, Welcome Page Not Loading
you need to have an .env
laravel does supply a .env.example
as just a boilerplate example. You need to make sure you have a .env that is configure to your actual setup you wish to have. This is also where you will set your database variables.
Replied to SQLSTATE[42S02]: Base Table Or View Not Found: 1146 Table
Did you also make sure the migration table was empty as well? I have ran into this issue before where if the migrations table still had data I had this error.