Is there a problem with just manuelly creating a model php file?

|
Siberfx 2020-05-31 19:55:13
laravel_discuss-39483.jpg

natghi2010 2020-05-31 19:59:57
Siberfx 2020-05-31 19:55:13

whats fillable?

Siberfx 2020-05-31 20:00:15
fields that you can update
Siberfx 2020-05-31 20:00:26
you are allowing which fields in the table going to be updated.
natghi2010 2020-05-31 20:01:10
ok thank you
Siberfx 2020-05-31 20:01:26
you can use instead of fillable :
protected $guarded = [”]
Siberfx 2020-05-31 20:01:36
so it means, all fields.
natghi2010 2020-05-31 20:02:27
Models are also where foreign keys are defined?
Siberfx 2020-05-31 20:06:04
you can set foreign keys through migrations, but its all storing into database.
Siberfx 2020-05-31 20:06:55
you reaching them by the relations or raw mysql queries. better read documents or watch vides on youtube “Coder’s Tape” or “Laracast”
Roham0010 2020-05-31 21:58:40
natghi2010 2020-05-31 19:48:48
is there a problem with just manuelly creating a model php file?

You can create models by yourself and it’s just fine and about table name as in documents said:
Table names are snake case and plural of the model name
it means that if your model class name is Post your table will be posts
if it’s PostComment the table name will be post_comments

Z_I_C_O_7 2020-05-31 22:01:27
Nguimfack 2020-05-31 18:49:13
I think that you try to save data in your database, but in your database, table posts don’t have column id

Yes i don’t have column id in database but I have column post_id

Siberfx 2020-05-31 22:02:16
Z_I_C_O_7 2020-05-31 22:01:27
Yes i don’t have column id in database but I have column post_id

post your migration file for that table.

Z_I_C_O_7 2020-05-31 22:02:39
cristian_madeira 2020-05-31 19:01:21
Did you run migration?

I did .

Siberfx 2020-05-31 22:02:47
where is it
Z_I_C_O_7 2020-05-31 22:04:12
For table posts
Siberfx 2020-05-31 22:05:00
if you post the screenshot of the migration and model, I can tell you the solution
natghi2010 2020-05-31 22:05:34
Siberfx 2020-05-31 22:05:00
if you post the screenshot of the migration and model, I can tell you the solution

its a secret 🙂

Z_I_C_O_7 2020-05-31 22:06:53
Siberfx 2020-05-31 22:05:00
if you post the screenshot of the migration and model, I can tell you the solution

Ok 👌

Z_I_C_O_7 2020-05-31 22:11:13
When click the link of edit
Route me to the error
Siberfx 2020-05-31 22:11:39
show the screenshots instead of speaking dude
Z_I_C_O_7 2020-05-31 22:13:13
Siberfx 2020-05-31 22:05:00
if you post the screenshot of the migration and model, I can tell you the solution

laravel_discuss-39507.jpg

Siberfx 2020-05-31 22:14:40
migration and model man
Z_I_C_O_7 2020-05-31 22:14:55
laravel_discuss-39509.jpg
For model
Siberfx 2020-05-31 22:15:10
look
Siberfx 2020-05-31 22:15:53
protected $primaryKey = ‘admin_id’; you should write it camelcase. primaryKey K is capslock.
Z_I_C_O_7 2020-05-31 22:22:15
Siberfx 2020-05-31 22:15:53
protected $primaryKey = ‘admin_id’; you should write it camelcase. primaryKey K is capslock.

🤦‍♂️🤦‍♂️🤦‍♂️
Thank you very much

Siberfx 2020-05-31 22:22:28
welcome
hicham0x 2020-06-01 02:50:08
i have this pb with instalation bootstrap in laravel
hicham0x 2020-06-01 02:50:21
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js –progress –hide-modules –config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:UsershichaAppDataRoamingnpm-cache_logs2020-05-31T23_47_51_944Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ dev: npm run development
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:UsershichaAppDataRoamingnpm-cache_logs2020-05-31T23_47_52_023Z-debug.log

hicham0x 2020-06-01 02:50:35
can you help me please
Gabby_Json 2020-06-01 02:53:34
laravel comes with bootsrap Mouden
Gabby_Json 2020-06-01 02:54:11
https://laravel.com/docs/7.x/frontend
hicham0x 2020-06-01 02:54:30
yes i went to use
hicham0x 2020-06-01 02:54:42
white laravel mix
Gabby_Json 2020-06-01 02:56:50
i have never used bootstrap with mix . Only when am using tailwindcss
Acird Burn 2020-06-01 07:59:08
Need a freelance full stack laravel PHP developer whose worked with angular js and vue js to help change a backend admin template installing a new admin template and migrating from vue js to angular front-end inbox if interested
Z_Yamin 2020-06-01 09:04:13
how to set csrf_token in this button:
//delete detail section
$(“#content-display”).on(‘click’, “.delete”, function () {

var id = $(this).attr(“id”);
//alert(id)
javascript:ajaxDelete(“admin/questionPackage/questionPackageDelete/” + id);
});

Vineeth Vijayan 2020-06-01 09:04:32
Dependency Injection in simple words
https://medium.com/vineeth-vijayan/dependency-injection-in-simple-words-51c0f87d6b74

Dependency Injection in simple wordsMedium
The word dependency means dependent on something. For example lets say our economy is dependent on oil exports.
Z_Yamin 2020-06-01 09:05:21
when i click on button whith class delete it say:
CSRF toke mismatch
Z_Yamin 2020-06-01 09:10:24
any one help please
Z_Yamin 2020-06-01 09:10:48
how to set csrf_token in this button:
//delete detail section
$(“#content-display”).on(‘click’, “.delete”, function () {

var id = $(this).attr(“id”);
//alert(id)
javascript:ajaxDelete(“admin/questionPackage/questionPackageDelete/” + id);
});

lmboom 2020-06-01 09:21:52
Z_Yamin 2020-06-01 09:10:48
how to set csrf_token in this button:
//delete detail section
$(“#content-display”).on(‘click’, “.delete”, function () {

var id = $(this).attr(“id”);
//alert(id)
javascript:ajaxDelete(“admin/questionPackage/questionPackageDelete/” + id);
});

is it an api call? so you do not need to set csrf in this case

Z_Yamin 2020-06-01 09:23:33
lmboom 2020-06-01 09:21:52
is it an api call? so you do not need to set csrf in this case

No it is not

Z_Yamin 2020-06-01 09:24:13
Just a moment i will share screenshot with you
Z_Yamin 2020-06-01 09:25:24
laravel_discuss-39539.jpg

Liemena 2020-06-01 10:52:29
laravel_discuss-39543.jpg
plz help, i use windows10
Liemena 2020-06-01 10:52:54
Version: 1.45.1 (user setup)
Commit: 5763d909d5f12fe19f215cbfdd29a91c0fa9208a
Date: 2020-05-14T08:27:35.169Z
Electron: 7.2.4
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.18362
Korosh_kv2000 2020-06-01 10:55:41
Liemena 2020-06-01 10:52:29
plz help, i use windows10

Don’t use &&

Nimit1906 2020-06-01 10:57:13
Hello friends
My laravel project locally working
But I m put on server so getting error 419
Help me any 1
|