namespace App\Http\Controllers;
use Illuminate\Http\Request;
class IntroductionController extends Controller
{
public function introduceYourself(Request $request)
{
$name = $request->input('name', 'Mahmoud Dwidar');
$occupation = $request->input('occupation', 'Full-Stack Developer');
$interests = $request->input('interests', ['PHP', 'Laravel', 'React.js']);
$introduction = "Hello, my name is {$name}. I am a {$occupation} and my interests include " . implode(', ', $interests) . ".";
return response()->json(['introduction' => $introduction]);
}
}
- “Any fool can write code that a computer can understand. Good programmers write code that humans can understand.” — Martin Fowler