Пример #1
0
 public function validLink(Request $req)
 {
     $parametres = $req->except(['_token']);
     //Links::create($parametres);
     $links = new Links();
     $links->nom = $parametres['nom'];
     $links->link = $parametres['lien'];
     $links->description = $parametres['description'];
     $links->save();
     return redirect()->route('listLink')->with('ok', 'ok tout c\'est bien passe');
 }
Пример #2
0
 public function createLink(Request $request)
 {
     $parameters = $request->except(['_token']);
     $parameters['slug'] = Str::slug($parameters['name']);
     $date = new \DateTime(null);
     $link = new Links();
     $link->name = $parameters['name'];
     $link->link = $parameters['link'];
     $link->description = $parameters['description'];
     $link->slug = $date->format('dmYhis') . '-' . Str::slug($parameters['name']);
     $link->save();
     return redirect()->route('listLink')->with('success', 'Item was added !');
 }