Jump to content

nickkecooper

Members
  • Posts

    16
  • Joined

  • Last visited

Posts posted by nickkecooper

  1. It's a standard URL, I do not know all the accepted file types. However I've used both JPG and PNG with no issues. Try putting them into /public_html/assets/**YOUR CHOICE AFTER THAT**. Try going to the image once you upload it there. If you can reach it, place that URL into the Image URL input within the ranks page.

     

  2. Hey guys! 

     

    I wanted to pick your brains about possibly getting the pireps to display based on the pilots hubs. I'd like to have it so you can go to a hub and see the pireps its filled. I am unsure how to do this the clean way! I know I can perform the following 

    @if ($pirep->user->home_airport->icao == 'KCLT')

    In doing it this way I lose any pagination features as it's just filtering through already gathered data.

     

    Any thoughts would be appreciated! 

  3.       {{ Form::model($staff, [
         'route' => ['staff::admin.update', $staff->id],
         'method' => 'patch',
         'id' => 'staffForm'])
    }}

     

    I made it this now. Still isn't working, saying it is undefined. I also changed the admin.php line to show what you had put. Maybe it is an issue with the modules. 

     

  4. Ill take a closer look. I can't use:

          {{ Form::model($airport, [
               'route' => ['admin.airports.update', $airport->id],
               'method' => 'patch',
               'id' => 'airportForm'])
          }}

    In a module. When I replace the route it does not like the route. I've tried a ton of things to get it to work but can't figure it out. 

  5. Yea but it doesnt seem like the developer used the same format, and its driving me crazy how he got it to work lol 

     

    The first solution you stated is the way he is doing it but I cant get it to work!

  6. Thanks! Do you happen to know a good way to insert into the database? I'm lost after the form submits and does it's checks... not sure where the actual insert sql command is! 🤪
     

    Figured that out. But having an issue on finding where findWithoutFail functions are stored. 

  7. Hey does anyone have some knowedlge on getting a custom module to talk with the UserRepo? I created a module, added the Repo as it was add on the frontend users listing. But I am getting nothing. When I try to print the array it comes back as php memory exceeded, however I do not believe its a php memory issue. My code for the module controller is:

     

    <?php
    
    namespace Modules\Staff\Http\Controllers\Admin;
    
    use App\Contracts\Controller;
    use App\Models\Enums\UserState;
    use App\Repositories\Criteria\WhereCriteria;
    use App\Repositories\UserRepository;
    use Illuminate\Http\Request;
    use Illuminate\Support\Facades\Log;
    use League\ISO3166\ISO3166;
    use Prettus\Repository\Exceptions\RepositoryException;
    /**
     * Class AdminController
     * @package Modules\Staff\Http\Controllers\Admin
     */
    class AdminController extends Controller
    {
      private $userRepo;
    
      /**
       * @param UserRepository $userRepo
       */
      public function __construct(UserRepository $userRepo)
      {
          $this->userRepo = $userRepo;
      }
    
    
        public function index(Request $request)
        {
          $where = [];
    
          if (setting('pilots.hide_inactive')) {
              $where['state'] = UserState::ACTIVE;
          }
    
          try {
              $this->userRepo->pushCriteria(new WhereCriteria($request, $where));
          } catch (RepositoryException $e) {
              Log::emergency($e);
          }
    
          $users = $this->userRepo
          ->with(['airline', 'current_airport'])
              ->orderBy('pilot_id', 'asc');
    
              return view('staff::admin.index', [
                  'users'   => $users,
              ]);
    
        }
    
    
        /**
         * Show the form for creating a new resource.
         */
        public function create()
        {
            return view('staff::admin.create');
        }
    
        /**
         * Store a newly created resource in storage.
         */
        public function store(Request $request)
        {
        }
    
        /**
         * Show the specified resource.
         */
        public function show()
        {
            return view('staff::admin.show');
        }
    
        /**
         * Show the form for editing the specified resource.
         */
        public function edit()
        {
            return view('staff::admin.edit');
        }
    
        /**
         * Update the specified resource in storage.
         */
        public function update(Request $request)
        {
        }
    
        /**
         * Remove the specified resource from storage.
         */
        public function destroy()
        {
        }
    }
    

    Any help would be appreciated!

×
×
  • Create New...