mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2025-12-14 12:06:46 +00:00
- Added `publicDisk` configuration to `filesystems.php`. - Expanded locale translations in `es.json` and `de.json`. - Implemented RSS, Atom, and JSON feed views. - Added `feed.php` configuration for feed generation. - Introduced `ImageController` for image handling. - Updated application routing to include `api.php`.
79 lines
2.0 KiB
PHP
79 lines
2.0 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Api;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Models\Lecturer;
|
|
use App\Models\Venue;
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
use Illuminate\Http\Request;
|
|
|
|
class VenueController extends Controller
|
|
{
|
|
/**
|
|
* Display a listing of the resource.
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function index(Request $request)
|
|
{
|
|
return Venue::query()
|
|
->with(['city:id,name,country_id', 'city.country:id,name,code'])
|
|
->select('id', 'name', 'city_id')
|
|
->orderBy('name')
|
|
->when(
|
|
$request->search,
|
|
fn(Builder $query) => $query
|
|
->where('name', 'ilike', "%{$request->search}%")
|
|
)
|
|
->when(
|
|
$request->exists('selected'),
|
|
fn(Builder $query) => $query->whereIn('id',
|
|
$request->input('selected', [])),
|
|
fn(Builder $query) => $query->limit(10)
|
|
)
|
|
->get()
|
|
->map(function (Venue $venue) {
|
|
$venue->flag = asset('vendor/blade-country-flags/4x3-' . $venue->city->country->code . '.svg');
|
|
$venue->description = $venue->city->name . ', ' . $venue->street;
|
|
|
|
return $venue;
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Store a newly created resource in storage.
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function store(Request $request)
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Display the specified resource.
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function show(Lecturer $lecturer)
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Update the specified resource in storage.
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function update(Request $request, Lecturer $lecturer)
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Remove the specified resource from storage.
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function destroy(Lecturer $lecturer)
|
|
{
|
|
//
|
|
}
|
|
}
|