About 8,260,000 results
Open links in new tab
  1. How do I create a model in laravel? - Stack Overflow

    I'm having some difficulties properly understanding laravel models. Let's take the default model provided by the framework as an example. This is the whole content of the Model: User.php …

  2. Laravel - create model, controller and migration in single artisan ...

    I can create a model and resource controller (binded to model) with the following command php artisan make:controller TodoController --resource --model=Todo I want to also create a …

  3. How to reload/refresh model from database in Laravel?

    In some of my tests, I have a user model I have created and I run some methods that need to save certain attributes. In rails, I would typically call something like user.reload which would …

  4. What is actually model in laravel and where it is used?

    May 4, 2017 · Laravel is an MVC base framework the Model is the M in the MVC pattern which maps your classes that extend Illuminate\Database\Eloquent\Model to your database tables …

  5. laravel - What is the meaning of Eloquent's Model::query ()?

    Jul 25, 2018 · What is the meaning of Eloquent's Model::query ()? Asked 7 years, 4 months ago Modified 1 year, 5 months ago Viewed 38k times

  6. php - Laravel eloquent model model attribute casting (Which …

    Oct 30, 2020 · Laravel eloquent model model attribute casting (Which attribute types should I cast?) Asked 5 years, 1 month ago Modified 5 years, 1 month ago Viewed 37k times

  7. Add a custom attribute to a Laravel / Eloquent model on load?

    Jun 21, 2013 · 289 I'd like to be able to add a custom attribute/property to an Laravel/Eloquent model when it is loaded. For instance, at the moment, in my controller I have:

  8. How to set a default attribute value for a Laravel / Eloquent model?

    How to set a default attribute value for a Laravel / Eloquent model? Asked 12 years, 2 months ago Modified 2 years, 3 months ago Viewed 96k times

  9. Laravel: Listen for Model save or update (after or before they're …

    How can I generate a function to call after or before save() or update()? I think I need a callback from save() update(), but how can I do it?

  10. How to use a boot () in laravel model? - Stack Overflow

    How to use a boot () in laravel model? Asked 4 years, 1 month ago Modified 4 years, 1 month ago Viewed 10k times