Questions tagged [laravel-views]

69 questions
90
votes
15 answers

How to pass data to view in Laravel?

Im passing data to my blade view with return View::make('blog', $posts); and in my blade view I'm trying to run an @foreach ($posts as $post) I end up with an error saying that $posts isn't defined. My question is how would the $posts array be…
Sam Pettersson
  • 3,049
  • 6
  • 23
  • 37
27
votes
17 answers

Laravel yield attribute

I'm trying to set an attribute using @yield and @section, but how? I tried to use and @section('mainApp','id="myid"') but it returns id="myid" instead of id="myid" I know that I can manage it with a default id…
Vixed
  • 3,429
  • 5
  • 37
  • 68
11
votes
1 answer

Views in Lumen 5.2+

I need to build a small widget, and was planning to use the Lumen for this because I need a quick response and I need components such as routing, translation, requests and views. the problem is noticed now that the views were discontinued after…
Miguel Borges
  • 7,549
  • 8
  • 39
  • 57
5
votes
3 answers
4
votes
2 answers

assign $attributes in nested Laravel 7 blade components

With Laravel 7, I began to use View Components. I am trying to pass the $attributes variable from one component to another like: x-modal component:
merge(['class' => 'modal fade']) }}> Something great...
x-modal-form…
Pythagus
  • 127
  • 1
  • 6
3
votes
2 answers

Laravel view from different folder

I have a laravel project where I have the following view: 'ProjectName\custom\subfolder\resources\views\theview.blade.php' How can I return this view? I tried to use view('theview') That did not work because that only works on views inside: …
Mister Verleg
  • 4,053
  • 5
  • 43
  • 68
3
votes
1 answer

TinyMCE and Laravel

I'm trying to use tinyMCE with my Laravel project. The problem is when I store the new article the html tags are not working. They're showing up like a plain text on display on my laravel view: This is the code implemented in…
frenchbaguette
  • 1,297
  • 6
  • 22
  • 41
2
votes
2 answers

Laravel Route Group for Views

I have below configuration in my Laravel /routes/web.php: Route::group(['prefix' => 'admin'], function(){ Route::get('/', function() { return view('admin.login'); }); }); If you observe, I have mentioned view('admin.login') this…
Veer Shrivastav
  • 5,434
  • 11
  • 53
  • 83
2
votes
0 answers

Laravel - validation Array to string conversion error

I have refereed these links but none of them are perfect and not working in my case. 1st , 2nd , 3rd and 4th I have simple form when user submit it's go to controller and check all validation rules if has any error redirect back to last page and…
Dhaval
  • 1,393
  • 5
  • 29
  • 55
2
votes
1 answer

Having a dynamic View folder path during runtime in laravel 5.3

I'm trying to build a saas application (saas here means software as a service) in laravel 5.3. I've build few service provider which collects the domain name, the theme being used and databases of those particular website. Now I'm trying to…
Nitish Kumar
  • 6,054
  • 21
  • 82
  • 148
1
vote
0 answers

Undefined variable when trying to load a view in Laravel

I have a file called create.blade.php inside directory resources/views/product/create.blade.php. I am trying to view the create.blade.php file inside index.blade.php that is located in resources/views/product/index.blade.php using include…
Code
  • 71
  • 6
1
vote
1 answer

Laravel: extending view from module

I have a module in my Laravel app (it could also be a composer package). This module has a view composer which sets an array to all views containing the routes which should be included in the main navigation of the app. The composer looks like…
Danaq
  • 633
  • 1
  • 6
  • 18
1
vote
1 answer

How to render Laravel tags inside html stored in s3

Good day to all. As the question title says, I do have HTML template code stored in s3 with Laravel tags on it, lets say: {{ $landing->title }} @foreach($landing->products as $product)

{{…

Oswaldo C.
  • 99
  • 7
1
vote
1 answer

How to display one of two options for parameter in view file laravel

I created a view file with the syntax : my name: {{$name}} and mail {{$email}} and I need to create a route with 2 parameters (one optional and one required) and this will be the sentence that will be shown : my name : ["name" or "name missing"] and…
1
vote
2 answers

How can i solve this error "Too few arguments to function App\Http\Controllers\CtnController::show(), 0 passed and exactly 1 expected"

I have reviewed similar questions but none of the solutions worked for me. I have show view that fetches data from the db which I want to display. I believe I have the right code for my show function on my CtnController but I keep getting this…
1
2 3 4 5