Last active
August 13, 2020 12:41
-
-
Save demirhanali/554d655cdd135f600ff57a441e22bb12 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use App\Writer; | |
use Illuminate\Http\Request; | |
class WriterController extends Controller | |
{ | |
public function store(Request $request) | |
{ | |
$writer = new Writer; | |
$writer->name = $request->name; | |
$writer->state = $request->state; | |
$writer->save(); | |
} | |
public function search(Request $request) | |
{ | |
return Writer::search($request->input('q'))->raw(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment