Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jgirgis's avatar

Php companion alternative for Atom IDE

I switched from using sublime text to using Atom but One great package I am missing is php companion which allow importing of namespaces and classes in laravel.

https://github.com/erichard/SublimePHPCompanion

I searched a lot but can't find any package like that for Atom and was wondering if anyone already found one or can guide me to another easy way of importing name spaces in Laravel.

0 likes
12 replies
keevitaja's avatar

Hey!

Care to explain why did you switch? Like what kind of advantages, besides free, atom has?

jgirgis's avatar

I really like git highlighting of files modified , files ignored also the interface seems a lot more friendly how to can search for packages and themes and read their documentations and see screenshots of their usage all in one place plus most of the features of sublime are already there with the same short-cuts so it doesn't feel like a difficult upgrade to get used to.

3 likes
Rufhausen-FER's avatar

I'm really, really close to switching myself full time. Atom just seems more "refined" than Sublime, but with all the speed. It's taken a while to get PHP linting working the way I want, but it's all working now. I'm also missing PHP Companion, though I don't rely on it too much. What I really need is a way to get php-fmt to run on save like I'm used to with Sublime. I'm sure there's a way. I just haven't figured it out yet.

Rufhausen-FER's avatar

I have figured out how to run php-fmt on save. Add the following to the init.coffee file:

atom.workspace.observeTextEditors (editor) ->
  editor.buffer.onWillSave ->
      atom.commands.dispatch(document.querySelector('atom-text-editor'), 'php-fmt:transform')
1 like
SP1966's avatar

On an Atom related note, Visual Studio Code, which is based upon the same underpinnings as Atom is pretty phenomenal when it comes to JS coding. If you use a framework there are likely Typescript TSD files available which give you some very nice autosence like hinting. I also like the git integration within VSC.

Microsoft takes a well earned beating among the coding community but VSC looks like it'll mature into an exceptional JS editor, splitting the difference between a raw editor's speed and an IDE's helpful features.

olimorris's avatar

@Rufhausen-FER - Amazing tip! Thank you.

I edited it just slightly to only run for .php files:

atom.workspace.observeTextEditors (editor) ->
    editor.buffer.onWillSave ->
        if path.extname(editor.getPath()) == ".php"
            atom.commands.dispatch(document.querySelector('atom-text-editor'), 'php-fmt:transform')

Oh and for anyone reading, I make sure my path to fmt.phar in Atom is actually the path in the Sublime Text 3 phpfmt package. Mainly because I asked the developer to put the 'SortUseNamespace' feature back.

1 like
codenex's avatar

I fail to see how suggesting alternative editors solves the posters original question...

Thanks jimmck for the link

Please or to participate in this conversation.