Category : view

I am fetching data from three tables in which two tables (departmentdata and cities) have same field name. So when i show name field in my view then it display the value of name field at last occurrence of the result set. //Controller source code $leads = DB::table(‘leaddata’) ->join(‘departmentdata’, ‘departmentdata.id’, ‘=’, ‘leaddata.department’) ->join(‘cities’, ‘cities.id’, ‘=’, ..

Read more

I want to get THIS value to use in my view web page Route::get(‘/create/project/client/{id}’, [ClientController::class, ‘fetchData’]); Route::post(‘/add_client/{id}’, [ClientController::class, ‘addClient’]); controller page class ClientController extends Controller { public function fetchData ($id) { $clients = DB::select(‘select * from users;’); return view(‘client’)->with(‘clients’, $clients); } public function addClient ($id) { return $id; } } client blade page <form action="{{ ..

Read more

I am new to laravel, I am trying display myaccount page using blade file in laravel. myaccount.blade.php is located in resources/views/myaccount.blade.php Route in web.php as: Route::get(‘/myaccount’, ‘[email protected]’); Then HomeController.php as: <?php namespace AppHttpControllers; use IlluminateHttpRequest; use AppUser; use IlluminateSupportFacadesAuth; use DB; class HomeController extends Controller { public function __construct() { $this->middleware(‘auth’); } public function index() ..

Read more

I want to make my url as canonical url in larave. but when I tried it changes a little bit different which working as a successful/active or visitable link but seems to be defferent into view my laravel url post url as follows – "https://……..com/post/%E0%A6%B0%E0%A6%BE%E0%A6%A4%E0%A7%87%20%E0%A6%B6%E0%A7%8D%E0%A6%B0%E0%A7%80%E0%A6%B2%E0%A6%99%E0%A7%8D%E0%A6%95%E0%A6%BE%E0%A6%B0%20%E0%A6%AC%E0%A6%BF%E0%A6%AA%E0%A6%95%E0%A7%8D%E0%A6%B7%E0%A7%87%20%E0%A6%AE%E0%A6%BE%E0%A6%A0%E0%A7%87%20%E0%A6%A8%E0%A6%BE%E0%A6%AE%E0%A6%AC%E0%A7%87%20%E0%A6%AC%E0%A6%BE%E0%A6%82%E0%A6%B2%E0%A6%BE%E0%A6%A6%E0%A7%87%E0%A6%B6" but it changes into follows – https://…….com/post/রাতে%20শ্রীলঙ্কার%20বিপক্ষে%20মাঠে%20নামবে%20বাংলাদেশ in laravel view ..

Read more

//FrontendController// namespace AppHttpControllersFrontend; use AppModelsBeat; use AppModelsLicense; use IlluminateHttpRequest; use AppHttpControllersController; class FrontendController extends Controller { public function index() { $beats = Beat::all(); $popular_licenses = License::where(‘popular’,’1′)->take(15)->get(); return view(‘frontend.index’, compact(‘popular_licenses’, ‘beats’)); } } //LicenseController// <?php namespace AppHttpControllersAdmin; use AppModelsBeat; use AppModelsGenre; use AppModelsLicense; use IlluminateHttpRequest; use IlluminateSupportFacadesDB; use AppHttpControllersController; use IlluminateSupportFacadesFile; class LicenseController extends Controller { ..

Read more

Inside a controller in Laravel I have this: public function index() { $users = User::orderBy(‘name’, ‘asc’)->paginate(13); $users2 = User::all(); return view(‘contatos.index’)->with(‘users’, $users); return view(‘auth.register’)->with(‘users’, $users2); } I know isn’t right, it’s just to demonstrate my logic. Is there a way to unite these two returns in a single return? Or even a much shorter form ..

Read more

Is there a practical way of accessing a view’s data on a higher level component? Let me explain: I have a Base Layout with just the core HTML tags views/layouts/base.blade.php <!DOCTYPE html> <html > <head> <title>Page Title</title> </head> <body> {{ $slot }} </body> </html> A Main Layout layout component extending this one views/layouts/main.blade.php <x-base-layout> <x-header-main ..

Read more

I am getting this error when trying to use the Str::limit in views ErrorException Undefined property: IlluminatePaginationLengthAwarePaginator::$body (View: C:UsersUSERDesktoplaravelsqnaresourcesviewsquestionsindex.blade.php) here is the code <div class="media-body"> <h3 class="mt-0">{{ $question->title }}</h3> {{ Str::limit($questions->body, 250) }} </div> Here is the controller namespace AppHttpControllers; use AppModelsQuestion; use IlluminateHttpRequest; // use IlluminateSupportStr; class QuestionsController extends Controller { // use Str; ..

Read more