-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
htmlspecialchars() expects parameter 1 to be string, object given #68
Comments
You've got an issue in your view file accordingly to the error message. Could you show it? |
Blade file @extends('layouts.manage')
@section('content')
<posts-index
:table-data="{{ $posts }}">
</posts-index>
@endsection Vue component <template>
<fragment>
<div class="level">
<div class="level-left">
<div class="level-item">
<h1 class="title">Администрирование постов</h1>
</div>
</div>
<div class="level-right">
<div class="level-item">
<a :href="route('manage.posts.create')" class="button is-link">
<b-icon
icon="plus">
</b-icon>
<span>Создать пост</span>
</a>
</div>
</div>
</div>
<div class="columns is-multiline">
<div class="column">
<b-table :data="data">
<template slot-scope="props">
<b-table-column field="title" label="Название">
{{ props.row.title }}
</b-table-column>
<b-table-column field="excerpt" label="Короткое">
{{ props.row.excerpt }}
</b-table-column>
<b-table-column field="status" label="Статус">
{{ props.row.status }}
</b-table-column>
<b-table-column label="Действия">
<!-- <a class="button is-outlined is-small m-r-5" :href="route('permissions.show', props.row.id)">Просмотр</a><a :href="route('permissions.edit', props.row.id)" class="button is-small is-outlined">Редактирование</a>-->
</b-table-column>
</template>
<template slot="empty">
<section class="section">
<div class="content has-text-grey has-text-centered">
<p>
<b-icon
pack="far"
icon="frown"
size="is-xxlarge">
</b-icon>
</p>
<p>Ничего нет</p>
</div>
</section>
</template>
</b-table>
</div>
</div>
</fragment>
</template>
<script>
export default {
props: ['tableData'],
data() {
return {
data: this.tableData
}
}
}
</script>
|
Your issue not related to this package. You cannot pass objects to Vue components this way:
It awaits a string, but you giving an object to it. Have you tried this way?
Or Blade alternative:
|
Ok, no error now, but I still can't see my posts... empty table with this line And why basic framework staff works fine without |
Ah.... you've applied scope, but not performed an action: Post::onlyNotPublished()->get(); |
Now I see that documentation isn't clear that it's just scopes. You could chain many scopes like: Post::onlyNotPublished()->withoutNotVerified()->get(); And so on. |
@Sogl thanks for pointing this out. I've updated documentation. |
Thx...now it works without |
@antonkomarev Hello! I try to use this package in my project.
Took info from this wiki page: https://github.com/cybercog/laravel-eloquent-flag/wiki/Publishable-model
One line from migration:
Model:
Database (posts table) content:
My Controller:
And finally I got an error:
dd result:
What I'm doing wrong?
p.s. Method
publish()
works fine.Laravel 5.8
laravel-eloquent-flag 5.1.2
The text was updated successfully, but these errors were encountered: