Level 17
I don't have any experience with Envoyer, but isn't this just a case of storing the users form-answers in a database and pull them up when the admin views the user profile?
# Migration
class CreateFormsTable extends Migration
{
public function up()
{
Schema::create(forms, function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('user_id');
$table->json('answers');
$table->timestamps();
});
}
}
# User class
class User
{
public function forms()
{
return $this->hasMany(Form::class);
}
}
# Form class
class Form
{
protected $casts = [
'answers' => 'array'
];
public function user()
{
return $this->belongsTo(User::class);
}
}
# Admin controller to show user profile
public function show(User $user)
{
return $user->forms->answers;
}