Skip to content

Instantly share code, notes, and snippets.

@Sean-Spallen
Last active May 10, 2019 08:45
Show Gist options
  • Save Sean-Spallen/a10e3ccf0fe2422bc4afc06cf7705006 to your computer and use it in GitHub Desktop.
Save Sean-Spallen/a10e3ccf0fe2422bc4afc06cf7705006 to your computer and use it in GitHub Desktop.
Laravel - Store Function
<?php
namespace App\Http\Controllers;
use App\Flight;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
class FlightController extends Controller
{
/**
* Create a new flight instance.
*
* @param Request $request
* @return Response
*/
public function store(Request $request)
{
// Validate the request...
$flight = new Flight;
$flight->name = $request->name;
$flight->save();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment