<?php namespace AppHttpControllers; use IlluminateHttpRequest; use IlluminateSupportFacadesDB; class DaftarController extends Controller { /** * Display a listing of the resource. * * @return IlluminateHttpResponse */ public function index() { // mengambil data dari table mahasiswa $mahasiswa = DB::table(‘mahasiswa’) -> get(); // mengirim data students ke view daftar return view(‘daftar’, [‘mahasiswa’ => $mahasiswa]); } /** * ..

Read more

i have problem when joining my tables the error says Undefined variable: spps $siswas = DB::table(‘siswa’) ->join(‘kelas’, ‘siswa.id_kelas’, ‘=’, ‘kelas.id_kelas’) ->join(‘spp’, ‘spp.id_spp’, ‘=’, ‘siswa.id_spp’ ) ->get(); $kelass = DB::table(‘kelas’)->get(); return view(‘admin.data_siswa’,compact(‘siswas’,’kelass’)); $spps = DB::table(‘spp’, ‘kelas’)->get(); return view(‘admin.data_siswa’,compact(‘siswas’,’spps’)); } i dont know how to defining the spp table, any one please suggest me idea Source: Ask ..

Read more

I’m working with Laravel 8 to develop my project which is an Online Forum. And here is my route to / uri: Route::get(‘/’, function () { $threads = AppModelsThread::paginate(15); return view(‘welcome’, compact(‘threads’)); }); And at welcome blade: @section(‘content’) @include(‘thread.partials.thread-list’) @endsection And at thread-list, I added this: @forelse($threads as $thread) Posted by <a href="{{route(‘user_profile’,$thread->user->name)}}">{{$thread->user->name}}</a> {{$thread->created_at->diffForHumans()}} @endforelse ..

Read more