Support the ongoing development of →
posted 10 years ago
Last updated 1 year ago.

hash9211 liked this thread


isn't there a helper function to get the base path? so try: $newName = substr($directory, strlen(class_basename($directory));

Last updated 1 year ago.

Yep, use class_basename() or simply just basename() which is already there for exactly this in php core.

$directories = array_map('basename', File::directories($path));
Last updated 1 year ago.

hash9211 liked this reply


The first answer was also good, but Tlgreg gave the complete answer in combination with the laravel code.

Here is the code intergrated into my files:


                 $directorySelect = array();
                foreach( $directories as $directory ) :
                $directorySelect[$directory] = $directory;
                endforeach;  $directories = array_map('basename', $directorySelect);
           echo Form::select('KAMdossierNummers', $directories) ?> 
Last updated 1 year ago.

Sign in to participate in this thread!


Your banner here too?

JeffreyR jeffreyr Joined 11 Feb 2014


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.