 <?php $__env->startSection('title',ucwords(str_replace('-',' ',$resource))); ?> <?php $__env->startSection('content'); ?><div class="space-y-6"><div><h1 class="text-2xl font-black"><?php echo e(ucwords(str_replace('-',' ',$resource))); ?></h1><p class="text-sm text-slate-500">Create, update and remove records.</p></div><form method="POST" action="<?php echo e(route('admin.resources.store',$resource)); ?>" class="card p-4"><?php echo csrf_field(); ?><div class="grid gap-3 md:grid-cols-3"><?php $__currentLoopData = $rules; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $f): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><label class="text-xs font-semibold uppercase"><?php echo e(str_replace('_',' ',$f)); ?><input class="input mt-1 w-full" name="<?php echo e($f); ?>" <?php if(in_array($f,['is_paid','is_active','requires_founder_approval'])): ?> type="checkbox" value="1" <?php endif; ?>></label><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></div><button class="btn btn-primary mt-4">Add record</button></form><div class="space-y-3"><?php $__currentLoopData = $rows; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><form method="POST" action="<?php echo e(route('admin.resources.update',[$resource,$row->id])); ?>" class="card p-4"><?php echo csrf_field(); ?> <?php echo method_field('PATCH'); ?><div class="grid gap-3 md:grid-cols-3"><?php $__currentLoopData = $rules; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $f): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><label class="text-xs font-semibold uppercase"><?php echo e(str_replace('_',' ',$f)); ?><input class="input mt-1 w-full" name="<?php echo e($f); ?>" value="<?php echo e(is_scalar($row->$f)?$row->$f:''); ?>" <?php if(in_array($f,['is_paid','is_active','requires_founder_approval'])): ?> type="checkbox" value="1" <?php if($row->$f): echo 'checked'; endif; ?> <?php endif; ?>></label><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></div><div class="mt-3 flex gap-2"><button class="btn btn-soft">Save</button><button form="delete-<?php echo e($row->id); ?>" class="btn btn-soft text-red-600">Delete</button></div></form><form id="delete-<?php echo e($row->id); ?>" method="POST" action="<?php echo e(route('admin.resources.destroy',[$resource,$row->id])); ?>"><?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?></form><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></div><?php echo e($rows->links()); ?></div><?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /Users/macbook/Desktop/crm/softsuite-cms/resources/views/admin/resources.blade.php ENDPATH**/ ?>