backpack-for-laravel

How to use Backpack for Laravel on existing project?

空扰寡人 提交于 2020-07-21 06:35:28
问题 I'm building a small app with Laravel and I juste discovered Backpack that looks very nice ! I downloaded it (I have a license), but I really don't know how to use it with my existing files (so far 3 controllers, 3 models and a few blade files) Maybe the answer is somewhere in the documentation, but I could not find it.. A detailed explanation would be mutch appreciated ! Thank you all and have a nice day! Cheers from France 回答1: suppose you have model called Person ... php artisan backpack

Laravel - Backpack select dependent from another select

自古美人都是妖i 提交于 2020-07-09 14:33:25
问题 I recently installed Laravel Backpack admin in my Laravel project. Currently right now I'm working on it. But I need help. So... What I want: I want to have two selects, first one is Category and the second one is Article . So Article select must depend on Category select. And Article belongsTo Category . Category-Article Category 1 = [ Article 1, Article 2, Article 3 ] Category 2 = [ Article 4, Article 5 ] This is just a showing of which article belongs to category. So for example, when I

ListEntries in table for relationship on show page - backpack for laravel

无人久伴 提交于 2020-06-29 04:14:24
问题 Just new with backpack. I search on official site and googled it, but dit not found an answer In laravel 7, using Backpack 4.1 My data model is : Customer has many addresses Relationship is configured in the Customer model : public function addresses() { return $this->hasMany(\App\Models\Address::class, 'user_id'); } Relationship is configured in the Address model : public function customer() { return $this->belongsTo(\App\Models\Customer::class); } public function country() { return $this-

Override CRUD views

丶灬走出姿态 提交于 2020-01-12 08:28:58
问题 I would like to override the CRUD views of the Laravel Backpack CRUD package, because I want to make small changes to the layout. But obviously I don't want to change the CRUD package itself. Is there an elegant to do this? 回答1: Before loading any views, Backpack for Laravel checks your resources/views/vendor/backpack/crud folder to see if you have any custom views. If you don't, it will just load the views in the package. If you want to overwrite a blade file for all CRUDS , you can just

BACKPACK Laravel manage extra columns in pivot table in a many-to-many relationship using Backpack CRUD

混江龙づ霸主 提交于 2020-01-05 05:40:09
问题 I'm using backpack for laravel and I'm trying to add/update some extra columns in a pivot table used in a many-to-many relationship. Summarizing the context: I have a model Task , another model Machine and this intermediate pivot table machine_task containing the many-to-many relation between Task and Machine In this machine_task there are machine_id , task_id and then boolean columns m (for 'monthly'), q (for 'quarterly'), b (for 'biannual') and y (for 'yearly'). This is what I have In my

What are the reordering columns on laravel-backpack?

允我心安 提交于 2020-01-04 02:33:11
问题 In the official documentation, the following columns are mentioned : parent_id lft rgt depth I haven't found any explanation of their types in the documentation. Could someone help me and tell me what they are ? I also want to know if they are all mandatory if I only want to reorder a list of items (I don't need any nesting). Edit: As this question is quite popular, I've updated the documentation with the correct info. 回答1: The reordering id columns should be integer or INT(10) if you're not

Can't add field from different table in laravel-backpack CRUD

拜拜、爱过 提交于 2020-01-03 01:48:05
问题 I have libraries , townships and states tables in the database ( Library , Township , State as model names). Library is 1-n to Township . In the Library . public function township(){ return $this->belongsTo('App\Township', 'township_id'); } In the Township Model public function libraries(){ return $this->hasMany('App\Library'); } And Township is 1-n to State . In the Township Model public function state() { return $this->belongsTo('App\State', 'state_id'); } In the State Model public function

Illegal offset type - Laravel 5.3 - ConnectionFactory.php - Every Model

那年仲夏 提交于 2019-12-14 03:54:37
问题 First sorry for bad english, not native. I'v an Laravel 5.3 App running on XAMPP, windows 7 machine. Everything was working great, and i don't have made any impact changes on code, it just happened. Everytime my app trys to build the connection with mysql this error is shown: FatalThrowableError in ConnectionFactory.php line 237: Illegal offset type in ConnectionFactory.php line 237 ConnectionFactory->createConnector(array('driver' => 'mysql', 'host' => '127.0.0.1', 'port' => '3306',