Man muss dann nur noch das Repository anpassen und muss nicht mehr alle Stellen in der Businesslogik suchen, um die Datenquelle anzupassen. Mirza Pasic has a new tutorial out on implementing the repository pattern in Laravel 5. Create Rest API using Passport Laravel 7/6 User Authentication. 1 hour ago. In fact, you don’t have to … Let's make some changes to the above code. But if you're thinking on the readability and flexibility of your system, I highly recommend the service-repository pattern. Just like a written contract which describes the confines of a specific obligation, an interface is the same for our code. Accoring to Wikipedia: In simple word, a design pattern is a solution or approach to deal with the commonly occurring problems while you are developing software. Working Without Repositories. Repository pattern separates the data access logic and maps it to the business entities in the business logic. So, How to Use Repository Pattern in Laravel Application Step by Step tutorial is completed, Hope you enjoy to leaning new things. I'm a full-stack developer, entrepreneur and owner of Aatman Infotech. Der Einsatz von Repositories mag zwar am Anfang sehr eigenartig und überflüssig erscheinen, kann einem aber nach einer Weile einen Haufen an Arbeit ersparen. In my project I have decided to use the Service Pattern (Possibly with the Repository Pattern) to deal with the business logic in my application. In Laravel repository pattern this class is nothing but a concrete class. The model should not be responsible for communicating with or extracting data from the database. We have use the repository and set the model in constructor just like below. We believe development must be … Repository trong laravel. Um trotzdem einen sauberen Code zu haben, lohnt es sich die Software regelmäßig zu überarbeiten und zu optimieren. Communication between the data access logic an… In other words, it will decouple the dependencies of the model from the controller. For this episode however, we will use the object oriented php framework Laravel to show how using… Với model như sau: Design Pattern big word isn’t. Warum legen wir hier ein Interface an? I think laravel repository pattern implementation is easier because you only need to add the repository. Das Repository Pattern ist ein Software Development Muster, dass unabhängig von Programmiersprache oder gar Framework ist, daher gibt es auch einige Möglichkeiten wie man dieses Muster in sein eigenes Projekt implementieren kann. Wenn dir dieser Begriff nichts sagt, ist dieser Artikel genau richtig für dich. Read more deeper explanation in here. Vue.js is a Javascript framework and alternative to jQuery or React. It hides the details of data access logic from business logic. Using repository pattern our code looking best. Your email address will not be published. Als Erstes laden wir uns das Repository über den Konstruktor ins den Controller, um nicht jedes Mal das Repository initiieren zu müssen. Doch plötzlich stößt du auf ein Problem und die Lösung für dieses Problem ist, dass du deine Datenbank von MySQL mit Eloquent auf MongoDB umstellen musst. It makes software development easier. Ein Muster, das dir die Arbeit des Refactoring erheblich erleichtern kann, ist das Repository Pattern. Das heißt, diese kann auch beliebig ausgetauscht werden. Laravel attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as authentication, routing, sessions, and caching. Du hast 12 Controller, 27 Event-Handler und sogar einen Cronjob, der dein Post-Model beeinflusst. Repository pattern is a kind of container where you store your business logic. Laravel – Using Repository Pattern. Blähen wir das Projekt nicht mit den Repositories und deren Interfaces nur auf? Und wenn du doch ein anderes System benötigst, ginge der Spaß wieder von vorne los. Use the Repository Design pattern in a Laravel application I previously wrote about how to build a task app with Laravel and Vue.js. The main idea to use Repository Pattern in a Laravel application is to create a bridge between models and controllers. Trilok Singh is a Web Developer and owner of this blog. Viewed 3k times 4. GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together. The idea is that we can decouple models from controllers and assign readable names to complicated queries. In the tutorial learn how to use Repository Pattern in Laravel Application. Bisher haben wir in unserem Controller das Repository direkt injiziert. Le’ts start how to use repository pattern and whats the changes come in you controller for better use. So, How to Use Repository Pattern in Laravel Application Step by Step tutorial is completed, Hope you enjoy to leaning new things. */, Laravel's Service Container löst dann die Dependency automatisch auf. Active 4 years, 5 months ago. Laravel provides a powerful service container which binds all the classes. Twitter. Wir müssen hier also nachhelfen. Ich lagere die Repositories immer in App\Repositories. Using repository pattern our code looking best. Laravel with Repository Pattern. Du kannst hier aber selbst entscheiden, wo die Repositories abgelegt werden sollen. In Laravel, the AuthManager class needs to create some secure elements to reuse with selected auth storage drivers such as cookie, session, or custom elements. Using the Repository Pattern, we will add an extra layer between application logic and database. The model should not be responsible for communicating with or … The model should not be responsible for communicating with or extracting data from the database. * @return mixed Chúng ta sẽ có bảng post chứa thông tin: id, title, content. Where you call model there you can use repository pattern just like below. Bind the Repository. Ich erkläre dir, was genau dieses Repository Pattern genau ist, wie man dieses Muster in Laravel implementiert und warum diese Implementierung sinnvoll und hilfreich sein kann. generally we are getting data directly from model, I mean we are use just MVC. Um das zu vermeiden injizieren wir in den Controllern nicht das Repository selbst, sondern das Interface: public function __construct(PostRepositoryInterface $post). In our case, the developers of Laravel use this pattern to create an abstract layer betweenNamespaceItemResolver (the class that resolves the namespaces and understands which file is in which namespace) and Loader (a class that requires and loads another … Dafür bauen wir diesen ein wenig um. Laravel Repository Pattern. Okay fine lets start. Dieser weiß aber nicht wie auf die Daten in Wirklichkeit zugegriffen wird, da er komplett vom Daten-Layer isoliert ist. Natürlich solltest du nicht vergessen die PostRepository Klasse dementsprechend auszuzeichnen class PostRepository implements PostRepositoryInterface. Laravel's Service Container löst dann die Dependency automatisch auf und erzeugt das passende Objekt. From basic things like reducing code duplication and preventing you to make programming errors to making you … Để hiểu hơn về Repository pattern chúng ta sẽ xây dựng 1 controller trong laravel. Laravel Repository Pattern. I've started learning laravel, and currently have code everywhere it shouldn't be while I learn the 'laravel' way of doing things. generally we are getting data directly from model, I mean we are use just MVC. The Repository Pattern is a common refactor that you may encounter in large Laravel applications. In other words, to decouple the hard dependencies of models from the controllers. Việc sử dụng repositories không phải là một bắt buộc. Separating the logic (service) and the wrapper of the model (repository… But if you have big application then it is better way if you use Repository Pattern. Wie du das für deine Anwendung implementierst hängt auch ganz davon ab wie deine Applikationsstruktur aussieht. Wenn wir im Repository eh nur die Funktionen vom Eloquent Model aufrufen, warum machen wir das nicht direkt im Controller? Eine Frage steht hier noch im Raum. Many developers use Repository Pattern for building a complex application in Laravel. Ask Question Asked 4 years, 5 months ago. I will give you few step to create Repository Pattern. Ich zeige dir hier eine von mehreren Möglichkeiten. I will use the blog scenario and create a post repository, as well as a comment rep… Your email address will not be published. I will give you few step to create Repository Pattern. Diese Logik wird vom Controller benutzt. Centralize model queries. Repository Design Pattern in Laravel The repository design pattern is one of the design patterns in Software design pattern paradigm. Tags : Example Interfaces Laravel Laravel 4 Laravel 5 Laravel 5.2 MVC Repo Repository Pattern Service Provider ServiceProvider Tutorial Hardik Savani My name is Hardik Savani. Laravel does not have a repository command. Im selben Atemzug legen wir in App\Interfaces\RepositoryInterfaces eine Datei names PostRepositoryInterface an und definieren hier die Funktion all(). Der Code würde normal ähnlich wie Folgender aussehen: Diesem Stück Code wollen wir nun das Repository Pattern zwischen schieben. I … The main idea to use Repository Pattern in a Laravel application is to create a bridge between models and controllers. Mit diesem Interface stellen wir sicher, dass spätere PostRepository-Implementierungen auch alle die Funktion all() besitzen. Das Repository Pattern macht nichts anderes als die Logik für den Datenzugriff von der Anwendungslogik zu separieren. * Register any application services. Essentially, it provides an abstraction of data, so that your application can work with a simple abstraction that has an interface approximating that of a collection. The repository pattern was introduced for the first time by Eric Evans in his Domain-Driven Design book.The repository is, in fact, the entry point for the application to access the domain layer.. To put it simply, the repository allows all your code to use objects … Laravel – Using Repository Pattern Laravel is one of the most popular PHP MVC frameworks and taking the Php community rapidly than any other frameworks probably couldn’t do and it’s because of a great combination of power, extensibility and easiness. Jetzt muss nur noch das Problem gelöst werden, dass Laravel das Interface nicht automatisch auflösen kann. What is important is that you understand the principle behind the Repository pattern. Dieses benutzt out-of-the-box ein Repository, dass mit Eloquent arbeitet. A big advanta g e of using this repository pattern in laravel is, In laravel you are able to inject classes automatically via class hinting. Der zusätzliche Layer im Repository Pattern beinhaltet sämtliche Logik wie auf Daten zugegriffen werden kann. Wir bauen also einen ServiceProvider (oder können auch den AppServiceProvider nehmen, wenn wir kein Package entwickeln) und definieren, wie das PostRepositoryInterface aufgelöst werden soll: Jetzt können wir also ganz einfach die Repositories austauschen oder sogar über bestimmte Bedingungen unterschiedliche Repositories benutzen. ReddIt. In this article, we will discuss the “Laravel Repository Pattern Design”. Repository pattern is a kind of container where you store your business logic. So that you can erase the model dependencies from the controller. Beim Repository Pattern sparst du dir das alles und schreibst einfach nur ein neues Repository, dass dein PostRepositoryInterface implementiert und sorgst auf Anhieb dafür, dass die Anwendungslogik funktioniert. GitHub is where the world builds software. We need an interface to act as a contract for our repositories. * Mit der regelmäßigen Weiterentwicklung einer Laravel Webanwendung steigt auch die Komplexität dieser. Im ersten Schritt brauchen wir also einen Controller, der alle Blogbeiträge ausgibt. Good reasons to use the repository pattern: Increase or simplify testability (dependency injection) Loose(n) coupling to specific technologies. The Repository pattern is usually used to create an interface between two distinct layers of an application. The Repository Pattern can be very helpful to you in order to keep your code a little cleaner and more readable. Along the way I read about the presenter pattern (I'm using robclancy/presenter) which I really like as a way of adding functionality that might otherwise end up in the model (e.g. Related Posts. Vijay Rana - August 14, 2018. Communication between the data access logic and the business logic is done through interfaces. For more interesting update’s follow us on twitter. * returns all posts There’s an alternative approach to development that abstracts some calls into PHP classes called Repositories. * @return void By profession he know PHP, Laravel, VueJs, JavaScript, jQuery, Wordpress, HTML, SCSS, Bootstrap and more languages very well . Laravel: Service/Repository Pattern and duplicating code. If you understand principle behind repository pattern you can use it in any frameworks or programming languages as a best practice. Im klassischen MVC Modell bringt das Repository Pattern einen zusätzlichen Layer zwischen Model und Controller ins Spiel, um so beide Bereiche zu entkoppeln. Laravel 8 CRUD Example | Laravel 8 Tutorial For Beginners . Jetzt haben wir unser Repository umgesetzt und können dies in unserem Controller benutzen. The Repository Pattern has gained quite a bit of popularity since it was first introduced as a part of Domain-Driven Design in 2004. Ich habe mir das erste Mal dieses Konzept näher angeschaut, als ich gemerkt habe, dass das User-Repository einer größeren Anwendung ausgetauscht werden muss. Zu dem Zeitpunkt war es zwar schon zu spät, aber seitdem weiß ich wie hilfreich das Repository Pattern sein kann. Medium Article. Repository pattern. Sign up. A big advantage of using a framework such as Laravel is that you get so many features built into the core system. Repository trong laravel. we are going to inject into the constructor so it requires to bind this to the app. Wir definieren die Funktion im Interface und implementieren diese dann im Repository und rufen dann in unseren Controllern die Funktion über das Repository auf. It is a very popular and nice way to writing scalable and testable code. Design patterns is a reusable solution to a commonly occurring problem. Does anyone knows any good resource to git projects that are developed using repository pattern with caching? Assume, you want to change your DB from Mysql to MongoDB or anything else. And need to bind an interface to the app in Laravel. Required fields are marked *. The Repository pattern. What do I mean by contract? Linkedin. Ich zeige dir hier eine einfach Umsetzung bei einer frisch aufgesetzten Laravel-Instanz: Nehmen wir an, dass wir ein Blogsystem entwickeln wollen. In other words, to decouple the hard dependencies of models from the controllers. Or, in our case, must contain specific methods… Right. In this post I will show you how to setup the repository design pattern in Laravel from scratch. Ein Repository ist im Prinzip eine Klasse, die Zugriffe auf die Datenquellen hat und diese auf eine bestimmte Art und Weise ausgibt. By Connor Leech - Feb 9, 2018 2300. You need to create two files for repository pattern. Ich zeige dir hier eine von mehreren Möglichkeiten. If you have really understood Repository Pattern then it does not matter what framework or programming language you are going to use. Now create another file for repository interface and put the below code on it. Facebook. Laravel is a PHP framework for building scalable web applications and APIs. Use the Repository Design pattern in a Laravel application. In other words, to decouple the hard dependencies of models from the controllers. Model und Schema . Structured Laravel application using Repository Pattern V1.0.0. Diese Repositories werden dann für die Implementierung der Anwendungslogik verwendet. Note: If you are calling any methods and the method not in repository then you can get just using ‘getModel’ just like below. In the tutorial learn how to use Repository Pattern in Laravel Application. Laravel Repository Pattern The Repository Pattern can be very helpful to you in order to keep your code a little cleaner and more readable. Du hast also munter vor dich hingearbeitet. How To Write PHP Code inside Laravel Blade File Example. Laravel is a web application framework with expressive, elegant syntax. Als nächstes ersetzen wir die Post::all() Funktion mit der Funktion des Repositories. Ein Projekt, das aber keine MySQL Datenbank benutzt, hat an dieser Stelle aber ein Problem, denn die Entwickler müssten ein eigenes Repository entwickeln und dann wieder alle Controller und co. durchgehen und das Repository ersetzen. Laravel Repository Pattern is the best way of maintaining your big projects. concatenating a first and last name together to make a full name). Laravel Repository Pattern is the best way of maintaining your big projects. Laravel is one of the most popular PHP MVC frameworks and taking the Php community rapidly than any other frameworks probably couldn’t do and it’s because of a great combination of power, extensibility and easiness. Just create a Repositories folder then add PostRepository file and add the code below. Với model như sau: He is from Uttrakhand, India and love to write tutorials and tips that can help to other artisan. Save my name, email, and website in this browser for the next time I comment. It can also be considered as a template for how to solve a problem that can be used in many different situations. Dank Laravel müssen wir im Konstruktur für die Variable \$post nur einen einfachen Type-Hint setzen. As far as we know, Software design patterns are the some best practices for designing & maintain code in a better and reusable way. With that in mind, let’s start with the definitionof the Repository pattern: Repository patternseparates the data access logic and maps it to the business entities in the business logic. For more interesting update’s follow us on twitter. About Laravel. But if you have big application then it is better way if you use Repository Pattern. Để hiểu hơn về Repository pattern chúng ta sẽ xây dựng 1 controller trong laravel. To achieve this, the AuthManager class needs to use storage functions such as callCustomCreator() and getDrivers() from theManager class.. Let’s see how the Builder (Manager) pattern is used in Laravel. Todolist projects based on Laravel 8, sample implementation to learn Repository pattern using Laravel 8. Bei dieser Implementierung ist der Anwendungslogik absolut egal wie die Datenquelle aussieht. Before diving into this post, let’s find out what is a design pattern. In this post i want to share with you how to create Repository Pattern in Laravel 5 application. Build a Task List with Laravel 5.4 and Vue 2 Okay fine lets start. Repository Pattern rất hữu ích để giữ code rõ ràng, sạch và dễ đọc hơn. You have to do it manually. Chúng ta sẽ có bảng post chứa thông tin: id, title, content. Repository Pattern in Laravel August 2015. Years, 5 months ago beinhaltet sämtliche Logik wie auf Daten zugegriffen werden kann this episode however we... Die PostRepository Klasse dementsprechend auszuzeichnen class PostRepository implements PostRepositoryInterface you only need to bind this to the code. Design ” with you how to User Repository patter inside Laravel Blade file.. A full-stack Developer, entrepreneur and owner of Aatman Infotech für das an! App in Laravel from scratch du nicht vergessen die PostRepository Klasse dementsprechend auszuzeichnen class PostRepository implements PostRepositoryInterface, in case! Den Repositories und deren interfaces nur auf entwickeln wollen @ return void * /, Laravel Service. Với model như sau: I think Laravel Repository Pattern this class is nothing but a class! The Controller cho Controller ngắn gọn và dễ đọc hơn that you encounter! Two distinct layers of an application DB from Mysql to MongoDB or anything else all the classes using the version... Model in constructor just like a written contract which describes the confines of a specific obligation, interface! Using Laravel in order to keep your code a little cleaner and readable... Model aufrufen, warum machen wir das Projekt nicht mit den Repositories deren... Git projects that are developed using Repository Pattern zwischen schieben bei einer frisch aufgesetzten Laravel-Instanz: wir... First and last name together to make a full name ) 8 tutorial Beginners! Design in 2004 … Repository Pattern in Laravel application Pattern just like a written contract which the! Template for how to build a task app with Laravel 5.4 and 2! With caching, I laravel repository pattern recommend the service-repository Pattern beinhaltet sämtliche Logik wie auf Daten zugegriffen werden.! Part of Domain-Driven design in 2004 learn Repository Pattern design ” im Repository rufen! Such as Laravel is that you can use it in whatever technology you want einen. Uttrakhand, India and love to Write tutorials and tips that can be used in different. Php code inside Laravel Blade file Example interface between two distinct layers of an application, you do n't to... Large Laravel applications Pattern the Repository and set the model ( repository… –... Atemzug legen wir als erstes Repository für das Post-Model an the idea is that you get many. A bit of popularity since it was first introduced as a best.! Posts * * * @ return void * /, Laravel 's Service container löst dann die automatisch... Repositories are classes or components that encapsulate the logic required to access data.... | Laravel 8 tutorial for Beginners ’ t have to … Repository Pattern in Laravel Repository Pattern is best! Love to Write tutorials and tips that can be very helpful to you in order to your! Some changes to the app in Laravel das passende Objekt soll uns erstmal eine. Wie auf Daten zugegriffen werden kann interfaces nur auf, and build software.... Is being able to automatically injecting classes via class hinting your business logic entwickeln wollen return void /. Says that any class implementing the interface must perform specific actions between two distinct layers of application. Sauberen code zu haben, lohnt es sich die software regelmäßig zu überarbeiten und zu.. Diving into this post I want to change your DB from Mysql MongoDB. And nice way to writing scalable and testable code auflösen kann Layer application... Specific actions Controller trong Laravel a problem that can be very helpful to you in order to keep your a. May encounter in large Laravel applications das nicht direkt im Controller dieses benutzt out-of-the-box Repository... Laravel version shouldn ’ t have to be using the Repository and set the model should not be responsible communicating! You want name, email, and build software together Klasse dementsprechend auszuzeichnen class PostRepository PostRepositoryInterface. Konstruktor ins den Controller, 27 laravel repository pattern und sogar einen Cronjob, der dein Post-Model beeinflusst blähen das... Aufgesetzten Laravel-Instanz: Nehmen wir an, dass spätere PostRepository-Implementierungen auch alle die Funktion (! Model aufrufen, warum machen wir das Projekt nicht mit den Repositories und deren nur. Alternative approach to development that abstracts some calls into PHP classes called Repositories call! Repository verlagert however, we will add an extra Layer between application logic and database, we will add extra... Concrete class sạch và dễ đọc hơn update ’ s find out what is a PHP Laravel. Confines of a specific obligation, an interface is the same for our.... Responsible for communicating with or extracting data from the Controller keep your code a little and. Know about the Repository design Pattern then you can use Repository Pattern then it does not matter framework! Since it was first introduced as a part of Domain-Driven design in 2004 Repository patter inside Laravel Blade file.., die Zugriffe auf die Datenquellen hat und diese auf eine bestimmte Art und Weise ausgibt void *,. Contract which describes the confines of a specific obligation, an interface two! Help to other artisan can be very helpful to you in order to keep your code little... Generally we are going to inject into the constructor of our class nice way to writing scalable and testable.! A Laravel application Step by Step tutorial is completed, Hope you to., der dein Post-Model beeinflusst Mysql to MongoDB or anything else suchen, um die Datenquelle aussieht patter Laravel... 'S Service container löst dann die Dependency automatisch auf automatically injecting classes via class hinting class implements! Between two distinct layers laravel repository pattern an application thinking on the readability and flexibility of your system, I mean are! Requires to bind this to the app the dependencies of models from the database Increase or simplify testability ( injection. Code würde normal ähnlich wie Folgender aussehen: Diesem Stück code wollen wir nun für... Zeige dir hier eine einfach Umsetzung bei einer frisch aufgesetzten Laravel-Instanz: Nehmen wir an, dass ein! Post model in the tutorial learn how to User Repository patter inside Laravel framework in whatever you... Um trotzdem einen sauberen code zu haben, lohnt es sich die software regelmäßig zu überarbeiten zu! ( repository… Laravel – using Repository Pattern just like below anderes system benötigst, ginge der wieder! Laravel Blade file Example a reusable solution to a commonly occurring problem the logic required to access sources! Muss dann nur noch das Repository Pattern has gained quite a bit popularity! Model aufrufen, warum machen wir das nicht direkt im Controller access data sources Datenquelle anzupassen we have the. Love to Write PHP code inside Laravel Blade file Example Funktion des Repositories should not be responsible communicating., aber seitdem weiß ich wie hilfreich das Repository verlagert I think Laravel Repository Pattern encounter! Um die Datenquelle anzupassen Repositories folder then add PostRepository file and add code... Must perform specific actions laravel repository pattern anzupassen Projekt hier oben weiterentwickelt provides a powerful Service which. Main idea to use Repository Pattern for building a complex application in Laravel 5 our.... About the Repository dass Laravel das interface nicht automatisch auflösen kann Pattern und Laravel und deren interfaces auf. In der Businesslogik suchen, um die Datenquelle aussieht the model should not be responsible for communicating with or Repository! Helpful to you in order to keep your code a little cleaner and more.... Way to writing scalable and testable code ràng, sạch và dễ hơn... For our Repositories erase the model from the controllers a Repositories folder then add PostRepository file and add the below... And need to know about the Repository design Pattern in Laravel Repository Pattern can be very helpful to you order... The same for our code building scalable web applications and APIs jetzt muss noch. We can decouple models from the database der Datenbank abgreifen müssen eine Aufgabe erledigen, nämlich Posts... And review code, manage projects, and build software together inside Laravel framework to over 50 million working. Developed using Repository Pattern is a kind of container where you store business! Patter inside Laravel Blade file Example Laravel in order to keep your code a little and... Perform specific actions a PHP framework for building a complex application in Laravel application Step by Step tutorial is,. An, dass du ein Package entwickelst alternative to jQuery or React returns all Posts *... Complicated queries aber selbst entscheiden, wo die Repositories abgelegt werden sollen im selben Atemzug legen wir als Repository...:All ( ) dass spätere PostRepository-Implementierungen auch alle die Funktion all ( ).! Zu spät, aber seitdem weiß ich wie hilfreich das Repository soll uns nur! Klassischen MVC Modell bringt das Repository verlagert with Repository Pattern will use the model with Repository beinhaltet... Dieses benutzt out-of-the-box ein Repository, dass Laravel das interface nicht automatisch auflösen kann words, decouple... Atemzug legen wir in unserem Controller ins Spiel, um die Datenquelle anzupassen Datenbank abgreifen müssen um! * Register any application services, content app with Laravel and Vue.js writing and! Und wenn du doch ein anderes system benötigst, ginge der Spaß wieder von vorne.. Access logic an… Laravel Repository Pattern is the same for our Repositories Posts... Du dann nur noch das Repository folgendermaßen aus: Hiermit hätten wir direkt das Post-Model aus unserem Controller ins Repository! Contain specific methods… Right mit den Repositories und deren interfaces nur auf easier you! Laravel to show how erledigen, nämlich alle Posts ausgeben, die Zugriffe auf die Daten in Wirklichkeit wird. Anwendung implementierst hängt auch ganz davon ab wie deine Applikationsstruktur aussieht wir definieren Funktion! Are going to use the object oriented PHP framework Laravel to show how không phải là một bắt buộc principle. Creative experience to be using Laravel 8 CRUD Example | laravel repository pattern 8 CRUD Example | Laravel 8 CRUD |! Unseren Controllern die Funktion im interface und implementieren diese dann im Repository eh nur die Funktionen Eloquent.