Jump to content

XPBaz

Members
  • Posts

    13
  • Joined

  • Last visited

  • Days Won

    2

XPBaz last won the day on November 29 2021

XPBaz had the most liked content!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

XPBaz's Achievements

Rookie

Rookie (2/14)

  • Collaborator Rare
  • One Month Later
  • Dedicated Rare
  • Week One Done
  • First Post Rare

Recent Badges

2

Reputation

  1. G'day and thank you for your help. I greatly appreciate it. I used the code below and got a Server Error 500. <?php namespace Modules\Awards\Awards; use App\Contracts\Award; /** * Simple example of an awards class, where you can apply an award when a user * has 100 flights. All award classes need to extend Award and implement the check() method * * See: https://docs.phpvms.net/developers/awards */ // Creating a new Award class class PilotBalanceAwards extends Award { // Award definitions public $name = 'Pilot Balance'; public $param_description = 'Amount of balance at which to give this award'; // Award method public function check($balance = null): bool { // Checking our own value to be sure if (!is_numeric($balance)) { Log::error('PilotBalanceAwards: Provided value "'.$balance.'" is not valid'); return false; } // Here we check the user's balance and return the result (true/false) return $this->user->journal->balance >= (int) $balance; } } The Laravel logged the following error... [2022-01-05 22:22:17] production.INFO: Bid for user: VAT0001 on flight VAT24/C.108/L.1 [2022-01-05 22:22:17] production.INFO: NotificationEvents::onPirepFile: jW2pzepPYjxQ0q34 filed [2022-01-05 22:22:17] production.ERROR: Object of class App\Support\Money could not be converted to int {"userId":1,"exception":"[object] (ErrorException(code: 0): Object of class App\\Support\\Money could not be converted to int at /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/modules/Awards/Awards/PilotMoneyAwards.php:51) [stacktrace] Edited... #23 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #24 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
  2. Thank you for your help so far. I made the suggested edits however I got an error. Then I started again editing the Flight time Award ending up with this below. Obviously I've missed something because this didn't tigger an award after passing the monetary amount set in the Awards interface. Can you see where I slipped up? Thanks Baz <?php namespace Modules\Awards\Awards; use App\Contracts\Award; use Illuminate\Support\Facades\Log; /** * All award classes need to extend Award and implement the check() method * This award is based on the original PilotFlightAwards.php file but * checks the Pilots money balance. * This award means you can create an award for a pilot that completes any * amount of money. * * See: https://docs.phpvms.net/developers/awards */ class PilotMoneyAwards extends Award { /** * Set the name of this award class to make it easier to see when * assigning to a specific award * * @var string */ public $name = 'Pilot Earnings Award'; /** * The description to show under the parameters field, so the admin knows * what the parameter actually controls. You can leave this blank if there * isn't a parameter. * * @var string */ public $param_description = 'Money Earned by pilot as $$$$'; /** * If the user has over N dollar, then we can give them this award. * * @param int|null $balance The parameters passed in from the UI * * @return bool */ public function check($balance = null): bool { if (!is_numeric($balance)) { Log::error('PilotMoneyAwards: Flight time "'.$balance.'" is not a valid amount'); return false; } return $this->user-> balance >= (int) $balance; } }
  3. G'day I'm looking to create an award that is automatically applied to set amounts of pilot money earned for example when looking at my pilot dashboard "Your Balance" and I reach $2000 the system gives an award in the same way you can have awards provided for a number of flights. Editing a copy of the PilotHoursAward.php, it seems to me I need the code that looks at "Your Balance" value. In the PilotHoursAward.php I think I'm looking to change the code in bold in the snippet of code below however I don't know what to change it to... (if I'm on the right track.) If anyone can provide direction it would be greatly appreciated. Baz public function check($flight_minutes = null): bool { if (!is_numeric($flight_minutes)) { Log::error('PilotHourAwards: Flight time "'.$flight_minutes.'" is not a valid flight time'); return false; } return $this->user->flight_time >= (int) $flight_minutes; }
  4. Thanks B
  5. It's all in the title however here are the details... I've set up an airline with the current version (7.0) VMS and Acars module. On the client side, is there a Mac X-Plane 10 client? Thanks for your response in advance. Baz
  6. Fixed it. I had to manually create a number of directories in my remote server and copy the php files up to each of them. Thanks for your help. B
  7. Thanks - still not quite there however I've worked out a couple of things. When I unzip the downloaded ACARS.zip it doesn't fully unzip either on my remote server or on my Mac locally. The Admin folder is just a file name rather than folder with content. On the Mac I get files with directory paths. (See below.) So I've manually created folders and uploaded the files less the path names however that still hasn't fixed it. Any ideas and thanks again. B
  8. Unfortunately I can't upload a zip of the log folder to send here. (It's not an accepted file type.) Maybe this includes the useful info from the laravel-2021-11-26.log file It continues this error multiple times over. [2021-11-26 05:39:53] production.INFO: Update: run_migrations {"_token":"olFLDDEbTr1J6C7xhAbrAF5CD7Y2JBKomXSoCHs9"} [2021-11-26 05:39:53] production.INFO: Running seeder [2021-11-26 05:39:53] production.INFO: Seeding ./home/bnasro5/AussieAirToursVirtual.bnasroberts.net/app/Database/seeds/prod/ranks.yml [2021-11-26 05:46:14] production.INFO: Update: run_migrations {"_token":"olFLDDEbTr1J6C7xhAbrAF5CD7Y2JBKomXSoCHs9"} [2021-11-26 05:46:14] production.INFO: Running seeder [2021-11-26 05:46:14] production.INFO: Seeding ./home/bnasro5/AussieAirToursVirtual.bnasroberts.net/app/Database/seeds/prod/ranks.yml [2021-11-26 09:55:00] production.ERROR: Target class [Modules\VMSAcars\Http\Controllers\Admin\AdminController] does not exist. {"exception":"[object] (Illuminate\\Contracts\\Container\\BindingResolutionException(code: 0): Target class [Modules\\VMSAcars\\Http\\Controllers\\Admin\\AdminController] does not exist. at /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Container/Container.php:879) [stacktrace] #0 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Container/Container.php(758): Illuminate\\Container\\Container->build('Modules\\\\VMSAcar...') #1 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(841): Illuminate\\Container\\Container->resolve('Modules\\\\VMSAcar...', Array, true) #2 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Container/Container.php(694): Illuminate\\Foundation\\Application->resolve('Modules\\\\VMSAcar...', Array) #3 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(826): Illuminate\\Container\\Container->make('Modules\\\\VMSAcar...', Array) #4 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Routing/Route.php(276): Illuminate\\Foundation\\Application->make('Modules\\\\VMSAcar...') #5 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Routing/Route.php(1051): Illuminate\\Routing\\Route->getController() #6 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Routing/Route.php(1012): Illuminate\\Routing\\Route->controllerMiddleware() #7 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Routing/Router.php(708): Illuminate\\Routing\\Route->gatherMiddleware() #8 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Routing/Router.php(688): Illuminate\\Routing\\Router->gatherRouteMiddleware(Object(Illuminate\\Routing\\Route)) #9 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Routing/Router.php(672): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request)) #10 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Routing/Router.php(636): Illuminate\\Routing\\Router->runRoute(Object(Illuminate\\Http\\Request), Object(Illuminate\\Routing\\Route)) #11 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Routing/Router.php(625): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request)) #12 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(166): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request)) #13 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request)) #14 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #15 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #16 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #17 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #18 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #19 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #20 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #21 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #22 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/app/Http/Middleware/TrustProxies.php(38): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #23 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\\Http\\Middleware\\TrustProxies->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #24 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #25 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(141): Illuminate\\Pipeline\\Pipeline->then(Object(Closure)) #26 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request)) #27 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/public/index.php(59): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request)) #28 {main} [previous exception] [object] (ReflectionException(code: -1): Class Modules\\VMSAcars\\Http\\Controllers\\Admin\\AdminController does not exist at /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Container/Container.php:877) [stacktrace] #0 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Container/Container.php(877): ReflectionClass->__construct('Modules\\\\VMSAcar...') #1 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Container/Container.php(758): Illuminate\\Container\\Container->build('Modules\\\\VMSAcar...') #2 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(841): Illuminate\\Container\\Container->resolve('Modules\\\\VMSAcar...', Array, true) #3 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Container/Container.php(694): Illuminate\\Foundation\\Application->resolve('Modules\\\\VMSAcar...', Array) #4 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(826): Illuminate\\Container\\Container->make('Modules\\\\VMSAcar...', Array) #5 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Routing/Route.php(276): Illuminate\\Foundation\\Application->make('Modules\\\\VMSAcar...') #6 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Routing/Route.php(1051): Illuminate\\Routing\\Route->getController() #7 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Routing/Route.php(1012): Illuminate\\Routing\\Route->controllerMiddleware() #8 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Routing/Router.php(708): Illuminate\\Routing\\Route->gatherMiddleware() #9 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Routing/Router.php(688): Illuminate\\Routing\\Router->gatherRouteMiddleware(Object(Illuminate\\Routing\\Route)) #10 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Routing/Router.php(672): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request)) #11 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Routing/Router.php(636): Illuminate\\Routing\\Router->runRoute(Object(Illuminate\\Http\\Request), Object(Illuminate\\Routing\\Route)) #12 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Routing/Router.php(625): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request)) #13 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(166): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request)) #14 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request)) #15 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #16 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #17 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #18 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #19 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #20 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #21 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #22 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #23 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/app/Http/Middleware/TrustProxies.php(38): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #24 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\\Http\\Middleware\\TrustProxies->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #25 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #26 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(141): Illuminate\\Pipeline\\Pipeline->then(Object(Closure)) #27 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request)) #28 /home/bnasro5/AussieAirToursVirtual.bnasroberts.net/public/index.php(59): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request)) #29 {main} "} [2021-11-26 09:55:03] production.ERROR: Target class [Modules\VMSAcars\Http\Controllers\Admin\AdminController] does not exist.
  9. Following this I entered "www.aussieairtoursvirtural.bnasroberts.net/update" into my browser and pressed "Start>>" at the update screen and "Run>>" and (Update Complete) "Finish>>" Went to VMSAcars in the Admin menu list and received 500 | Server Error. I've run the update several times with no success. Help and advice greatly appreciated. B
  10. Thanks for the advice. It all looked a bit different on my mac. I appreciate you helping. B
  11. Please excuse me for my lack of understanding however I've set my site up - tested it and purchased the Acars download. Following the install instructions I've hit a wall time sending back to do a clean install because the whole thing fails on me so I'm looking for clarification and a little more direct instruction. Step 1 (from Installation (Server) page) For the server-side installation, open the Web folder and copy the VMSAcars into your phpvms/modules folder: - done. Question: the file I download unzips as a folder calls ACARS. The instruction and graphic are VMSAcars. What should my server side folder be called (in the modules folder)? Step 2 (from Installation (Server) page) Then go to your site's URL to the /update folder, and follow through the update. When there are updates (as notified in the ACARS Changelog), you will do the same thing - copy the module folder in and then run the /update again. Question: Where is the /update folder and can someone please outline the remaining part of this step please? Thanks B
×
×
  • Create New...