I'm new to laravel backpack so what did is created a CRUD of title and description. And everything in admin panel works fine, but now I need to get that data to another blade view file through a controller like in a vanilla laravel but I cant seem to find how to do it.
2 Answers
If I understand your question correctly, there's absolutely NOTHING special you need to do - just do it "the normal Laravel way", by using your Model to query the database. It's usually something like Career::all()
or Career::find($id)
or Career::where('something', $value)->get()
, depending on what you need to fetch from the database.
That's because Backpack uses your existing Eloquent Models, or creates the models if you don't have them already (usually in app\Models
). So whenever you create/edit/delete an entry using the Backpack interface (aka CRUD), what Backpack does is use that Model to interact with the database. If you want to interact with the database, you should do the same thing - use the Model. That's the expected and recommended way of doing things in Laravel. To have Models for all your major database tables and do most (or all) of your interactions with the database using the Eloquent Models.
You can use view like this:
view('crud::show');
list, create etc.
all available files, you can find here: vendor/backpack/crud/src/resources/views/crud
If you want to override the template, please copy vendor template to your project
vendor/backpack/crud/src/resources/views/crud/show.blade.php > resources/views/vendor/backpack/crud/show.blade.php