/LaravelOpener

Open view files and named routes quickly.

Primary LanguagePython

Laravel Opener - Sublime Text 3 plugin

Open view files and named routes quickly.

Prerequisites

  1. Sublime Text 3
  2. Laravel or Lumen installation
  3. composer.json in the project's root directory

Installation

GitHub

  1. Change to your Sublime Text Packages directory
  2. Clone repository git clone https://github.com/pszucs/LaravelOpener.git 'LaravelOpener'

Manual installation

  1. Download the latest stable release
  2. Unzip the archive to your Sublime Text Packages directory

Setup

  1. Add the project's root directory to the project's config file Sublime -> Project -> Edit project:
    "laravel_opener_project_root": "your_app_root"

    this is to help determine which directory to work in if you have multiple directories added to the project

  2. Open Packages / LaravelOpener / LaravelOpener.sublime-settings and change these if necessary
  3. Add / replace the key combination in Sublime -> Preferences -> Key Bindings to trigger the plugin:
    {"keys": ["ctrl+shift+o"], "command": "laravel_opener" }

Usage

Open view files from the controller

Method 1

  1. Place the cursor on the line in the source file where the link to the view file is.
    return view('user.edit.permissions', compact('user', 'roles'));

Supported methods: view(), View::make(), @include()

  1. Press the key combination (default: ctrl+shift+o)

    if the view file doesn't exist and you save the file it will be saved in the appropriate directory

controller_view

Method 2

  1. Navigate to the controller method using the Command Palette - this will select/highlight the function name.
  2. Press the key combination (default: ctrl+shift+o)

controller_method_name_view

Open controllers from the routes file

  1. Place the cursor on the line in the routes file where the controller and method is defined:
    Route::post('upload/store_image', ['as' => 'image', 'uses' => 'FileUploadController@storeImage']);
  2. Press the key combination (default: ctrl+shift+o) and the controller opens with the method name selected. Press the key combination again and the view file opens too.

routes_controller_view

Named routes (temporarily disabled)

  1. Place the cursor in the source file where the link to the route is.
    {{ route("createUser") }}
  2. Press the key combination (default: ctrl+shift+o)

Disclaimer

I'm not a Python programmer. ;)