<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Form &#8211; The Eternal Path</title>
	<atom:link href="https://arasan.de/tag/form/feed/" rel="self" type="application/rss+xml" />
	<link>https://arasan.de</link>
	<description>Arasan.de</description>
	<lastBuildDate>Fri, 16 Sep 2022 13:09:33 +0000</lastBuildDate>
	<language>de</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.2</generator>

<image>
	<url>https://arasan.de/wp-content/uploads/2024/10/triquetra-512x512-1.png</url>
	<title>Form &#8211; The Eternal Path</title>
	<link>https://arasan.de</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Symfony TodoApp &#8211; Löschen-Funktion für TodoItems erzeugen</title>
		<link>https://arasan.de/symfony-todoapp-loeschen-funktion-fuer-todoitems-erzeugen/</link>
		
		<dc:creator><![CDATA[«Æ»]]></dc:creator>
		<pubDate>Fri, 16 Sep 2022 13:09:32 +0000</pubDate>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Form]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[SymfonyTodoApp]]></category>
		<guid isPermaLink="false">https://arasan.de/?p=646</guid>

					<description><![CDATA[In diesem Schritt fügen wir einen Löschen-Button zum Löschen von TodoItems in dem index Twig Template hinzu: Der Löschen Button ist analog zu dem Editieren Button, das ganze sieht im Browser so aus: Bei Klick auf den Löschen Button wird im TodosController die Lösch-Funktion über den EntityManager ausgelöst:]]></description>
										<content:encoded><![CDATA[<ol style="margin: 20px"><li><a href="https://arasan.de/symfony-todoapp-projekt-mit-git-github-erstellen/">Symfony TodoApp &#8211; Projekt mit Git + Github erstellen</a></li><li><a href="https://arasan.de/symfony-todoapp-todoscontroller-erstellen/">Symfony TodoApp &#8211; TodosController erstellen</a></li><li><a href="https://arasan.de/symfony-todoapp-twig-template-anpassen/">Symfony TodoApp &#8211; Twig Template anpassen</a></li><li><a href="https://arasan.de/symfony-todo-app-bootstrap-styles-hinzufuegen/">Symfony Todo App &#8211; Bootstrap Styles hinzufügen</a></li><li><a href="https://arasan.de/symfony-todo-app-todoscontroller-create-route-hinzufuegen/">Symfony Todo App &#8211; TodosController: Create Route hinzufügen</a></li><li><a href="https://arasan.de/symfony-todo-app-datenbankverbindung-erstellen/">Symfony Todo App &#8211; Datenbankverbindung erstellen</a></li><li><a href="https://arasan.de/symfony-todo-app-entity-repository-erstellen/">Symfony Todo App &#8211; Entity + Repository erstellen</a></li><li><a href="https://arasan.de/symfony-todo-app-todoitems-aus-tableplus-tabelle-anzeigen/">Symfony Todo App – TodoItems aus TablePlus Tabelle anzeigen</a></li><li><a href="https://arasan.de/symfony-todo-app-formular-fuer-erstellen-von-todoitems-erzeugen/">Symfony todo App &#8211; Formular für Erstellen von TodoItems erzeugen</a></li><li><a href="https://arasan.de/symfony-todo-app-formular-fuer-bearbeiten-von-todoitems-erzeugen/">Symfony Todo App &#8211; Formular für Bearbeiten von TodoItems erzeugen</a></li><li>Symfony TodoApp &#8211; Löschen-Funktion für TodoItems erzeugen</li><li><a href="https://arasan.de/symfony-todoapp-login-registrierung-hinzufuegen/">Symfony TodoApp &#8211; Login + Registrierung hinzufügen</a></li></ol>



<p class="wp-block-paragraph">In diesem Schritt fügen wir einen Löschen-Button zum Löschen von TodoItems in dem index Twig Template hinzu:</p>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="2896" height="1840" src="https://arasan.de/wp-content/uploads/2022/09/symfony-symfapp-delete-twig-template-todo-item-form.png" alt="" class="wp-image-647"/></figure>



<p class="wp-block-paragraph">Der Löschen Button ist analog zu dem Editieren Button, das ganze sieht im Browser so aus:</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" src="https://arasan.de/wp-content/uploads/2022/09/symfony-symfapp-bootstrap-5-create-todo-item-add-delete-button-browser.png" alt="" class="wp-image-648" width="555" height="387"/></figure>



<p class="wp-block-paragraph">Bei Klick auf den Löschen Button wird im TodosController die Lösch-Funktion über den EntityManager ausgelöst:</p>



<figure class="wp-block-image size-full"><img decoding="async" width="2894" height="1836" src="https://arasan.de/wp-content/uploads/2022/09/symfony-symfapp-todoscontroller-delete-todo-item-form-vscode.png" alt="" class="wp-image-649"/></figure>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Symfony Todo App &#8211; Formular für Bearbeiten von TodoItems erzeugen</title>
		<link>https://arasan.de/symfony-todo-app-formular-fuer-bearbeiten-von-todoitems-erzeugen/</link>
		
		<dc:creator><![CDATA[«Æ»]]></dc:creator>
		<pubDate>Fri, 16 Sep 2022 10:18:38 +0000</pubDate>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Form]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[SymfonyTodoApp]]></category>
		<guid isPermaLink="false">https://arasan.de/?p=637</guid>

					<description><![CDATA[Jetzt erstellen wir das Bearbeiten-Formular für TodoItems. Dazu fügen wir zuerst einen Editieren-Button in unserem index Twig Template hinzu: Das sieht im Browser so aus: Wir übergeben an den Pfad zum Erzeugen des Edit-Buttons die jeweilige ItemId. Über diese Id können wir dann das entsprechende TodoItem über das Repository laden und zum Bearbeiten an das&#8230;]]></description>
										<content:encoded><![CDATA[<ol style="margin: 20px"><li><a href="https://arasan.de/symfony-todoapp-projekt-mit-git-github-erstellen/">Symfony TodoApp &#8211; Projekt mit Git + Github erstellen</a></li><li><a href="https://arasan.de/symfony-todoapp-todoscontroller-erstellen/">Symfony TodoApp &#8211; TodosController erstellen</a></li><li><a href="https://arasan.de/symfony-todoapp-twig-template-anpassen/">Symfony TodoApp &#8211; Twig Template anpassen</a></li><li><a href="https://arasan.de/symfony-todo-app-bootstrap-styles-hinzufuegen/">Symfony Todo App &#8211; Bootstrap Styles hinzufügen</a></li><li><a href="https://arasan.de/symfony-todo-app-todoscontroller-create-route-hinzufuegen/">Symfony Todo App &#8211; TodosController: Create Route hinzufügen</a></li><li><a href="https://arasan.de/symfony-todo-app-datenbankverbindung-erstellen/">Symfony Todo App &#8211; Datenbankverbindung erstellen</a></li><li><a href="https://arasan.de/symfony-todo-app-entity-repository-erstellen/">Symfony Todo App &#8211; Entity + Repository erstellen</a></li><li><a href="https://arasan.de/symfony-todo-app-todoitems-aus-tableplus-tabelle-anzeigen/">Symfony Todo App – TodoItems aus TablePlus Tabelle anzeigen</a></li><li><a href="https://arasan.de/symfony-todo-app-formular-fuer-erstellen-von-todoitems-erzeugen/">Symfony todo App &#8211; Formular für Erstellen von TodoItems erzeugen</a></li><li>Symfony Todo App &#8211; Formular für Bearbeiten von TodoItems erzeugen</li><li><a href="https://arasan.de/symfony-todoapp-loeschen-funktion-fuer-todoitems-erzeugen/">Symfony TodoApp &#8211; Löschen-Funktion für TodoItems erzeugen</a></li><li><a href="https://arasan.de/symfony-todoapp-login-registrierung-hinzufuegen/">Symfony TodoApp &#8211; Login + Registrierung hinzufügen</a></li></ol>



<p class="wp-block-paragraph">Jetzt erstellen wir das Bearbeiten-Formular für TodoItems. Dazu fügen wir zuerst einen Editieren-Button in unserem index Twig Template hinzu:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2896" height="1842" src="https://arasan.de/wp-content/uploads/2022/09/symfony-symfapp-edit-twig-template-todo-item-form.png" alt="" class="wp-image-640"/></figure>



<p class="wp-block-paragraph">Das sieht im Browser so aus:</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" src="https://arasan.de/wp-content/uploads/2022/09/symfony-symfapp-bootstrap-5-create-todo-item-add-edit-button-browser.png" alt="" class="wp-image-643" width="602" height="410"/></figure>



<p class="wp-block-paragraph">Wir übergeben an den Pfad zum Erzeugen des Edit-Buttons die jeweilige ItemId. Über diese Id können wir dann das entsprechende TodoItem über das Repository laden und zum Bearbeiten an das Formular übergeben:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2894" height="1840" src="https://arasan.de/wp-content/uploads/2022/09/symfony-symfapp-todoscontroller-edit-todo-item-form-vscode.png" alt="" class="wp-image-641"/></figure>



<p class="wp-block-paragraph">Im folgenden Schritt erstellen wir das edit Twig Template mit dem Formular:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2898" height="1838" src="https://arasan.de/wp-content/uploads/2022/09/symfony-symfapp-create-twig-template-todo-item-add-edit-button.png" alt="" class="wp-image-642"/></figure>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" src="https://arasan.de/wp-content/uploads/2022/09/symfony-symfapp-bootstrap-5-edit-todo-item-form-browser.png" alt="" class="wp-image-644" width="578" height="258"/></figure>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Symfony todo App &#8211; Formular für Erstellen von TodoItems erzeugen</title>
		<link>https://arasan.de/symfony-todo-app-formular-fuer-erstellen-von-todoitems-erzeugen/</link>
		
		<dc:creator><![CDATA[«Æ»]]></dc:creator>
		<pubDate>Thu, 15 Sep 2022 19:32:28 +0000</pubDate>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Form]]></category>
		<category><![CDATA[Formular]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[SymfonyTodoApp]]></category>
		<guid isPermaLink="false">https://arasan.de/?p=625</guid>

					<description><![CDATA[In diesem Schritt erstellen wir ein Formular, das wir für das Erstellen von TodoItems verwenden: Das erstellte FormType sieht so aus (wir fügen außerdem den Submit-Button hinzu): Danach fügen wir in der twig.yaml Konfigurationsdatei ein Form-Theme hinzu, damit unser Formular mit Bootstrap-Klassen gestylt wird: Unser Formular kann sich im Browser sehen lassen:]]></description>
										<content:encoded><![CDATA[<ol style="margin: 20px"><li><a href="https://arasan.de/symfony-todoapp-projekt-mit-git-github-erstellen/">Symfony TodoApp &#8211; Projekt mit Git + Github erstellen</a></li><li><a href="https://arasan.de/symfony-todoapp-todoscontroller-erstellen/">Symfony TodoApp &#8211; TodosController erstellen</a></li><li><a href="https://arasan.de/symfony-todoapp-twig-template-anpassen/">Symfony TodoApp &#8211; Twig Template anpassen</a></li><li><a href="https://arasan.de/symfony-todo-app-bootstrap-styles-hinzufuegen/">Symfony Todo App &#8211; Bootstrap Styles hinzufügen</a></li><li><a href="https://arasan.de/symfony-todo-app-todoscontroller-create-route-hinzufuegen/">Symfony Todo App &#8211; TodosController: Create Route hinzufügen</a></li><li><a href="https://arasan.de/symfony-todo-app-datenbankverbindung-erstellen/">Symfony Todo App &#8211; Datenbankverbindung erstellen</a></li><li><a href="https://arasan.de/symfony-todo-app-entity-repository-erstellen/">Symfony Todo App &#8211; Entity + Repository erstellen</a></li><li><a href="https://arasan.de/symfony-todo-app-todoitems-aus-tableplus-tabelle-anzeigen/">Symfony Todo App – TodoItems aus TablePlus Tabelle anzeigen</a></li><li>Symfony todo App &#8211; Formular für Erstellen von TodoItems erzeugen</li><li><a href="https://arasan.de/symfony-todo-app-formular-fuer-bearbeiten-von-todoitems-erzeugen/">Symfony Todo App &#8211; Formular für Bearbeiten von TodoItems erzeugen</a></li><li><a href="https://arasan.de/symfony-todoapp-loeschen-funktion-fuer-todoitems-erzeugen/">Symfony TodoApp &#8211; Löschen-Funktion für TodoItems erzeugen</a></li><li><a href="https://arasan.de/symfony-todoapp-login-registrierung-hinzufuegen/">Symfony TodoApp &#8211; Login + Registrierung hinzufügen</a></li></ol>



<p class="wp-block-paragraph">In diesem Schritt erstellen wir ein Formular, das wir für das Erstellen von TodoItems verwenden:</p>



<pre class="wp-block-code"><code>php bin/console make:form TodoItemFormType TodoItem</code></pre>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1822" height="482" src="https://arasan.de/wp-content/uploads/2022/09/symfony-symfapp-php-bin-console-make-form-todoitemformtype-todoitem.png" alt="" class="wp-image-627"/></figure>



<p class="wp-block-paragraph">Das erstellte FormType sieht so aus (wir fügen außerdem den Submit-Button hinzu):</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2888" height="1640" src="https://arasan.de/wp-content/uploads/2022/09/symfony-symfapp-todoitem-form-type.png" alt="" class="wp-image-629"/></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2892" height="1634" src="https://arasan.de/wp-content/uploads/2022/09/symfony-symfapp-create-twig-template-todo-item-form.png" alt="" class="wp-image-630"/></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2892" height="1838" src="https://arasan.de/wp-content/uploads/2022/09/symfony-symfapp-todoscontroller-create-todo-item-form-vscode.png" alt="" class="wp-image-631"/></figure>



<p class="wp-block-paragraph">Danach fügen wir in der twig.yaml Konfigurationsdatei ein Form-Theme hinzu, damit unser Formular mit Bootstrap-Klassen gestylt wird:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2906" height="1642" src="https://arasan.de/wp-content/uploads/2022/09/symfony-symfapp-bootstrap-5-layout-form-theme-twig-yaml.png" alt="" class="wp-image-632"/></figure>



<p class="wp-block-paragraph">Unser Formular kann sich im Browser sehen lassen:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1810" height="1684" src="https://arasan.de/wp-content/uploads/2022/09/symfony-symfapp-bootstrap-5-create-todo-item-layout-theme-browser.png" alt="" class="wp-image-633"/></figure>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Laravel TodoApp &#8211; Todo ListItem als erledigt markieren</title>
		<link>https://arasan.de/laravel-todoapp-todo-listitem-als-erledigt-markieren/</link>
		
		<dc:creator><![CDATA[«Æ»]]></dc:creator>
		<pubDate>Fri, 09 Sep 2022 14:39:32 +0000</pubDate>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Blade Templates]]></category>
		<category><![CDATA[Form]]></category>
		<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Model]]></category>
		<category><![CDATA[Tabelle]]></category>
		<category><![CDATA[TodoApp]]></category>
		<guid isPermaLink="false">https://arasan.de/?p=405</guid>

					<description><![CDATA[Nun können wir uns daran machen, unsere neu angelegten Todos als erledigt zu markieren.Dazu brauchen wir pro ListItem einen Button, der das jeweilige als erledigt markiert: Erledigte Todos haben vor dem Eintrag ein &#8222;✓&#8220;, unerledigte werden mit &#8222;o&#8220; dargestellt.Das ganze ist in dem Template der root-Route (&#8222;Welcome.blade.php&#8220;) definiert: Hier haben wir eine if/else Bedingung und&#8230;]]></description>
										<content:encoded><![CDATA[<ol style="margin: 20px"><li><a href="https://arasan.de/laravel-projekt-mit-git-github-erstellen/">Laravel TodoApp &#8211; Projekt mit Git + Github erstellen</a></li><li><a href="https://arasan.de/laravel-view-blade-template-in-atom-editor-bearbeiten/">Laravel TodoApp &#8211; View (Blade Template) in Atom Editor bearbeiten:</a></li><li><a href="https://arasan.de/laravel-mysql-datenbank-verbindung-konfigurieren/">Laravel TodoApp &#8211; MySQL Datenbank-Verbindung konfigurieren</a></li><li><a href="https://arasan.de/laravel-todoapp-model-migration-erstellen/">Laravel TodoApp &#8211; Model + Migration erstellen</a></li><li><a href="https://arasan.de/laravel-todoapp-listitem-form-route-controller-erstellen/">Laravel TodoApp &#8211; ListItem Form + Route + Controller erstellen</a></li><li><a href="https://arasan.de/laravel-todoapp-formulardaten-in-logdatei-ausgeben/">Laravel TodoApp &#8211; Formulardaten in Logdatei ausgeben</a></li><li><a href="https://arasan.de/laravel-todoapp-formulardaten-in-tabelle-speichern/">Laravel TodoApp &#8211; Formulardaten in Tabelle speichern</a></li><li><a href="https://arasan.de/laravel-todoapp-listitems-aus-tabelle-ausgeben/">Laravel TodoApp &#8211; ListItems aus Tabelle ausgeben</a></li><li>Laravel TodoApp &#8211; Todo ListItem als erledigt markieren</li><li><a href="https://arasan.de/laravel-todoapp-layout-erstellen/">Laravel TodoApp &#8211; Layout erstellen</a></li><li><a href="https://arasan.de/laravel-todoapp-bootstrap-hinzufuegen/">Laravel TodoApp &#8211; Bootstrap hinzufügen</a></li><li><a href="https://arasan.de/laravel-todoapp-welcome-blade-template-umbenennen-in-todos/">Laravel TodoApp &#8211; Welcome Blade Template umbenennen in Todos</a></li><li><a href="https://arasan.de/laravel-todoapp-todo-nur-eintragen-wenn-user-angemeldet/">Laravel TodoApp &#8211; Todo nur eintragen wenn User angemeldet</a></li><li><a href="https://arasan.de/laravel-todoapp-nur-eigene-todos-anzeigen-und-bearbeiten/">Laravel TodoApp &#8211; Nur eigene Todos anzeigen und bearbeiten</a></li></ol>



<p class="wp-block-paragraph">Nun können wir uns daran machen, unsere neu angelegten Todos als erledigt zu markieren.<br>Dazu brauchen wir pro ListItem einen Button, der das jeweilige als erledigt markiert:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2228" height="998" src="https://arasan.de/wp-content/uploads/2022/09/laravel-todoapp-ausgabe-von-listitems-mit-complete-button-browser.png" alt="" class="wp-image-406"/></figure>



<p class="wp-block-paragraph">Erledigte Todos haben vor dem Eintrag ein &#8222;✓&#8220;, unerledigte werden mit &#8222;o&#8220; dargestellt.<br>Das ganze ist in dem Template der root-Route (&#8222;Welcome.blade.php&#8220;) definiert:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2512" height="1672" src="https://arasan.de/wp-content/uploads/2022/09/laravel-todoapp-ausgabe-von-listitems-mit-complete-button-in-welcome-view.png" alt="" class="wp-image-407"/></figure>



<p class="wp-block-paragraph">Hier haben wir eine if/else Bedingung und ein Formular mit Submit-Button pro ListItem.<br>Dazu wird das Formular bei Klick auf den &#8222;Complete&#8220;-Button an eine neue Route (mit einem Parameter $id) geschickt.<br>Der Parameter ist notwendig, damit wir das richtige ListItem als erledigt markieren.<br>Nun folgt die Erstellung der Route in der Datei web.php:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2506" height="1670" src="https://arasan.de/wp-content/uploads/2022/09/laravel-todoapp-form-listitem-complete-route-erstellen.png" alt="" class="wp-image-408"/></figure>



<p class="wp-block-paragraph">In der Route gibt es eine Neuerung, es wird ein Parameter &#8222;$id&#8220; verwendet &#8211; als gültiger Parameter ist eine Zahl definiert (id ist eine Zahl).<br>Außerdem haben wir die Route benannt, damit wir einfacher darauf zugreifen können. </p>



<p class="wp-block-paragraph">Im TodoListController ergänzen wir die Methode &#8222;markItemAsComplete&#8220;, die diesen Anwendungsfall behandelt. </p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2500" height="1672" src="https://arasan.de/wp-content/uploads/2022/09/laravel-todoapp-form-listitem-complete-methode-in-todolistcontroller-erstellen.png" alt="" class="wp-image-409"/></figure>



<p class="wp-block-paragraph">Als weitere Optimierung können wir den &#8222;Complete&#8220;-Button nur dann anzeigen, wenn der Todo Eintrag noch nicht abgeschlossen ist:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2514" height="1666" src="https://arasan.de/wp-content/uploads/2022/09/laravel-todoapp-ausgabe-von-listitems-mit-complete-button-in-welcome-view-nur-wenn-nicht-complete.png" alt="" class="wp-image-410"/></figure>



<p class="wp-block-paragraph">Zu guter Letzt können wir die Farben anpassen:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2514" height="1668" src="https://arasan.de/wp-content/uploads/2022/09/laravel-todoapp-ausgabe-von-listitems-mit-complete-button-angepasste-farben-in-welcome-view.png" alt="" class="wp-image-411"/></figure>



<p class="wp-block-paragraph">Unser Ergebnis kann sich sehen lassen:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2214" height="960" src="https://arasan.de/wp-content/uploads/2022/09/laravel-todoapp-ausgabe-von-listitems-mit-complete-button-angepasste-farben-browser.png" alt="" class="wp-image-412"/></figure>



<p class="wp-block-paragraph">Nun checken wir die Änderungen ein und aktualisieren unser Github Repository mit dem folgenden Befehl:</p>



<pre class="wp-block-code"><code>git push origin master</code></pre>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1824" height="556" src="https://arasan.de/wp-content/uploads/2022/09/laravel-todoapp-git-push-origin-master.png" alt="" class="wp-image-422"/></figure>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Laravel TodoApp &#8211; ListItem Form + Route + Controller erstellen</title>
		<link>https://arasan.de/laravel-todoapp-listitem-form-route-controller-erstellen/</link>
		
		<dc:creator><![CDATA[«Æ»]]></dc:creator>
		<pubDate>Thu, 08 Sep 2022 17:22:54 +0000</pubDate>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Controller]]></category>
		<category><![CDATA[CSRF]]></category>
		<category><![CDATA[Form]]></category>
		<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Route]]></category>
		<category><![CDATA[TodoApp]]></category>
		<guid isPermaLink="false">https://arasan.de/?p=357</guid>

					<description><![CDATA[In diesem Schritt erstellen wir das Formular, über das die Todo-Liste erweitert werden kann: Wir erstellen hier ein Formular mit einer Action, die eine eigene Route beim Senden des Formulars aufruft.Diese Route nennen wir &#8222;saveItem&#8220; &#8211; die Route werden wir gleich noch definieren.Außerdem haben wir ein verstecktes CSRF Eingabefeld mit &#8222;@csrf&#8220; erstellt, das automatisch ein&#8230;]]></description>
										<content:encoded><![CDATA[<ol style="margin: 20px"><li><a href="https://arasan.de/laravel-projekt-mit-git-github-erstellen/">Laravel TodoApp &#8211; Projekt mit Git + Github erstellen</a></li><li><a href="https://arasan.de/laravel-view-blade-template-in-atom-editor-bearbeiten/">Laravel TodoApp &#8211; View (Blade Template) in Atom Editor bearbeiten:</a></li><li><a href="https://arasan.de/laravel-mysql-datenbank-verbindung-konfigurieren/">Laravel TodoApp &#8211; MySQL Datenbank-Verbindung konfigurieren</a></li><li><a href="https://arasan.de/laravel-todoapp-model-migration-erstellen/">Laravel TodoApp &#8211; Model + Migration erstellen</a></li><li>Laravel TodoApp &#8211; ListItem Form + Route + Controller erstellen</li><li><a href="https://arasan.de/laravel-todoapp-formulardaten-in-logdatei-ausgeben/">Laravel TodoApp &#8211; Formulardaten in Logdatei ausgeben</a></li><li><a href="https://arasan.de/laravel-todoapp-formulardaten-in-tabelle-speichern/">Laravel TodoApp &#8211; Formulardaten in Tabelle speichern</a></li><li><a href="https://arasan.de/laravel-todoapp-listitems-aus-tabelle-ausgeben/">Laravel TodoApp &#8211; ListItems aus Tabelle ausgeben</a></li><li><a href="https://arasan.de/laravel-todoapp-todo-listitem-als-erledigt-markieren/">Laravel TodoApp &#8211; Todo ListItem als erledigt markieren</a></li><li><a href="https://arasan.de/laravel-todoapp-layout-erstellen/">Laravel TodoApp &#8211; Layout erstellen</a></li><li><a href="https://arasan.de/laravel-todoapp-bootstrap-hinzufuegen/">Laravel TodoApp &#8211; Bootstrap hinzufügen</a></li><li><a href="https://arasan.de/laravel-todoapp-welcome-blade-template-umbenennen-in-todos/">Laravel TodoApp &#8211; Welcome Blade Template umbenennen in Todos</a></li><li><a href="https://arasan.de/laravel-todoapp-todo-nur-eintragen-wenn-user-angemeldet/">Laravel TodoApp &#8211; Todo nur eintragen wenn User angemeldet</a></li><li><a href="https://arasan.de/laravel-todoapp-nur-eigene-todos-anzeigen-und-bearbeiten/">Laravel TodoApp &#8211; Nur eigene Todos anzeigen und bearbeiten</a></li></ol>



<p class="wp-block-paragraph">In diesem Schritt erstellen wir das Formular, über das die Todo-Liste erweitert werden kann:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2990" height="1664" src="https://arasan.de/wp-content/uploads/2022/09/laravel-todoapp-form-listitem-erstellen.png" alt="" class="wp-image-358"/></figure>



<p class="wp-block-paragraph">Wir erstellen hier ein Formular mit einer Action, die eine eigene Route beim Senden des Formulars aufruft.<br>Diese Route nennen wir &#8222;saveItem&#8220; &#8211; die Route werden wir gleich noch definieren.<br>Außerdem haben wir ein verstecktes <a href="https://laravel.com/docs/9.x/csrf">CSRF Eingabefeld</a> mit &#8222;@csrf&#8220; erstellt, das automatisch ein Token einfügt.<br>Im Browser sieht das Formular folgendermaßen aus:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2220" height="820" src="https://arasan.de/wp-content/uploads/2022/09/laravel-todoapp-form-listitem-browser.png" alt="" class="wp-image-359"/></figure>



<p class="wp-block-paragraph">Vor Erstellen der Route erstellen wir unseren Controller &#8222;TodoListController&#8220;, der die neue Route &#8222;saveItem&#8220; bearbeitet:</p>



<pre class="wp-block-code"><code>php artisan make:controller TodoListController</code></pre>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1828" height="420" src="https://arasan.de/wp-content/uploads/2022/09/laravel-todoapp-form-listitem-todolist-controller-erstellen.png" alt="" class="wp-image-363"/></figure>



<p class="wp-block-paragraph">Jetzt erstellen wir die <a href="https://laravel.com/docs/9.x/routing#basic-routing">Route in der Datei &#8222;web.php&#8220;</a>, die wir eben im Formular verwendet haben. Hier haben wir auch noch die Startroute in &#8222;root&#8220; benannt:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2990" height="1668" src="https://arasan.de/wp-content/uploads/2022/09/laravel-todoapp-form-listitem-route-erstellen.png" alt="" class="wp-image-361"/></figure>



<p class="wp-block-paragraph">Die Route &#8222;saveItem&#8220; funktioniert nur über einen POST Request (unser Formular sendet die Daten als POST Request).<br>Der TodoListController erhält die Daten vom Formular, jetzt brauchen wir im Controller noch die Methode &#8222;saveItem&#8220;.<br>Zunächst machen wir in der Methode eine einfache Weiterleitung auf die &#8222;root&#8220; Route (das Formular wird abgeschickt und wird wieder angezeigt).</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2990" height="1662" src="https://arasan.de/wp-content/uploads/2022/09/laravel-todoapp-todolistcontroller-saveitem-methode-erstellen.png" alt="" class="wp-image-364"/></figure>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
