Working on the homepage
This commit is contained in:
@@ -3,9 +3,27 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\File;
|
||||
|
||||
class ImagesController extends Controller
|
||||
{
|
||||
public function jobs()
|
||||
{
|
||||
$path = resource_path('images/Jobs');
|
||||
|
||||
if (!File::exists($path)) {
|
||||
return response()->json([]);
|
||||
}
|
||||
|
||||
$files = File::files($path);
|
||||
|
||||
$filenames = array_map(function ($file) {
|
||||
return $file->getFilename();
|
||||
}, $files);
|
||||
|
||||
return response()->json($filenames);
|
||||
}
|
||||
|
||||
public function show(Request $request, string $file)
|
||||
{
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user