Jump to content
in2tech

Learning Basic Laravel & phpVMS 7

Recommended Posts

First off should I ask these type questions here or in the Off Top Bantor area? I think since they are related to phpVMS 7 & Laravel this will be alright, but let me know if I am wrong. So after getting Laravel installed and learning some very basic, I mean basic thing's about Laravel & phpVMS I have a few questions and some info.

1 - Is it possible to add a new function that would point to a view for say Awards in the http/routes/web.php and create a NEW view in the views folder and point it to the view and would it work? Just curious. Might give it a try just for the heck of it.

 

2- Also in digging around ( sorry if I am not suppose too ), I always wondered how I could change the number of pilots that show up on the Home page. Right now it is set for 4, and that is all it shows total! So I dug around and noticed a file that could be changed in the Http/Controllers/Frontend area called HomeController.php and guess what I found? This code and changed it, and it worked :)

 

	<?php
	namespace App\Http\Controllers\Frontend;
	use App\Interfaces\Controller;
use App\Models\User;
use Illuminate\Database\QueryException;
	/**
 * Class HomeController
 */
class HomeController extends Controller
{
    /**
     * Show the application dashboard.
     */
    public function index()
    {
        try {
            $users = User::orderBy('created_at', 'desc')->take(8)->get();
        } catch (QueryException $e) {
            return view('system/errors/not_installed');
        }
	        return view('home', [
            'users' => $users,
        ]);
    }
}
	

Changed the 4 to an 8 , where it states take(8), and now I can list up to 8 NEW pilots :) Just having fun digging and learning the basics! Of 8 is it as NEW pilots register it kicks off the oldest one so it will never go over whatever number you make it. If that makes sense. And then of course there is the Pilot List anyway, which shows them all!

So now it looks like this:

 

2018-10-19_0243

I can show up to 8 of the newest pilots registrations instead of just 4. But like I said doubt you would want more or even change it, as you have the pilot/users list. But I must say I do at least like 8 :) Just messing around as I said! As you can see I also reformatted the way it looks, etc...

Edited by in2tech

Share this post


Link to post
Share on other sites

Nice! I can convert the pilot count into a setting.

For #1 - I'm not sure what you're trying to do.

Share this post


Link to post
Share on other sites
On 10/25/2018 at 9:33 AM, Nabeel said:

Nice! I can convert the pilot count into a setting.

For #1 - I'm not sure what you're trying to do.

That would be cool, where would it be, admin panel? Yeah so long since I posted this, I am not sure what #1 means either anymore. I was more likely asking if I could make a NEW route and a View for info, I guess, but not really sure anymore :) 

 

Sorry, should have made it more clear when I posted it! I'm old and just forgot!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×